![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Dec 2008
Posts: 25
Thanks: 0
Thanked 0 times in 0 posts
|
Hi there. When I'm using an indicator that has two bins, such as AO with it's positive and negative, how do I reference the following idea:
when the AO(Positive) bin has a value, *do this* when the AO(Negative) bin has a value, *do that* I seem to remember coming across a NT script command to accomplish this for me, but I can't find it now. Any ideas? thanks, Dwayne |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
You want to call the individual plots separately.
So for instance let us pretend the plot names are A and B. Code:
if (AO(some parameters).A[0] > someValue)
// Do something;
if (AO(some parameters).B[0] > someOtherValue)
// Do something else;
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2008
Posts: 25
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Josh,
Thanks for the reply. Here is what I have now: if (AO().AOPos[0] >= AO().AONeg[0])...do something. But this isn't quit it. AOPos and AONeg can either: 1. have some value 2. be empty and not contain any value at all I want to reference the condition where AO().AOPos[0] is not empty (condition #1). It can be any value. I simply want to know if it has a number in there. Reason being, if I am in a short position, AO().AONeg will have values. At some point, when the Falling() condition reverses, AO().AOPos[0] will get a value, even though it may be a negative value at first. How do I test for the condition "when AOPos gets a value"....? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
You have 3 plots. AOPos, AONeg, and AOValue. AOValue being a whole series with both pos and neg values. You can just compare AOPos against AOValue and AONeg against AOValue. Whichever one has the match is the one that has the value set.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Dec 2008
Posts: 25
Thanks: 0
Thanked 0 times in 0 posts
|
Bingo! Thanks very much for the insight. Works perfectly.
Enjoy your holidays, D |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| indicator folder empty when trying to import | ctmach | Installation and Licensing | 3 | 11-15-2009 02:00 PM |
| referencing an empty value | paschall | Strategy Development | 1 | 10-13-2009 04:35 AM |
| empty folders | ckait | Miscellaneous Support | 15 | 04-27-2009 03:14 PM |
| High and Low empty for ADX indicator... | wayneFH | Indicator Development | 1 | 05-05-2008 10:53 PM |
| Empty Indicator List | yimbot | Charting | 6 | 10-17-2007 10:27 PM |