![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2011
Posts: 190
Thanks: 16
Thanked 6 times in 6 posts
|
Can someone point me in the right direction to learn how to create a loop (or whatever is necessary) to do the following:
While a certain condition is met, add the result of an indicator (such as volume) on each successive bar and store it as a double or int that can be plotted. Thank you for any tips. |
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
Code:
private double TotalSum = 0; Code:
bool ConditionMet = false; // code to evaluate and set ConditionMet goes here if (ConditionMet) TotalSum += Volume[0]; else TotalSum = 0; |
|
|
|
|
|
The following 2 users say thank you to koganam for this post: |
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2011
Posts: 190
Thanks: 16
Thanked 6 times in 6 posts
|
koganam, as always, thank you for your help
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Dec 2011
Posts: 190
Thanks: 16
Thanked 6 times in 6 posts
|
If I have an indicator that plots both in a separate indicator panel (using plots) and then places lines on the chart, how do I set this up in the script?
Thank you EDIT: With a quick search, it looks like that is not possible. I'll create two indicators
Last edited by jmflukeiii; 07-07-2012 at 01:16 PM.
|
|
|
|
|
|
#5 |
|
Senior Member
|
Look up DrawOnPricePanel.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| getting color of previous bars | ziggymeister | Strategy Development | 1 | 11-16-2011 02:10 AM |
| Color previous bars | pauly139 | Indicator Development | 2 | 03-28-2011 11:49 AM |
| summation High/summation bar | K. SATO | General Programming | 3 | 05-03-2010 05:53 AM |
| Summation (SUM) | jcash | General Programming | 29 | 07-27-2009 07:10 AM |
| Data from previous bars | stljeffbb | Miscellaneous Support | 2 | 08-01-2008 11:32 PM |