PDA

View Full Version : Trend from one point to another


ct
11-18-2007, 10:02 PM
Is there an easy way (beside programming a loop) to check if a value has trended only down from a given point? I don't need nbarnsdown/up because the numbers of bars can vary.

Example: I want to know if a stochastic has only traveled down when it hits 20 and started at 80. I just need to know which bar 80 started at.

Maybe the better question is how can I find out which bar a value was reached or exceeded.

Regards/Danke

Cliff

NinjaTrader_Josh
11-18-2007, 10:26 PM
You can try using the CrossAbove or CrossBelow condition along with MRO.

http://www.ninjatrader-support.com/HelpGuideV6/CrossAbove.html
http://www.ninjatrader-support.com/HelpGuideV6/CrossBelow.html
http://www.ninjatrader-support.com/HelpGuideV6/MostRecentOccurenceMRO.html

ct
11-18-2007, 10:31 PM
Josh

Thanks for the reply. That will give me the bar when the value was reached or exeeded. Got it.

And this use this value for nbarsup/down to verify there were no opposite trending bars in the period?

NinjaTrader_Josh
11-18-2007, 10:47 PM
That will give you the bar that it got to your threshold value and then you will have to run some logic to come back and test if there were any counter trending bars. Only way I can think of to do this check is with a loop though. You will get the bar # of the threshold. Just use a counter that goes from 0 up to that bar # and check all those bars for a counter trend. If a counter trend happens then stop the loop and stop the trade I suppose.

ct
11-18-2007, 10:49 PM
Got it. Thanks.

ct
11-18-2007, 11:57 PM
Dog food, MRO will NOT work on multi-time frame strategies. Mine is.

NinjaTrader_Josh
11-19-2007, 12:08 AM
Then you might need to resort to loops.

ct
11-19-2007, 12:10 AM
Thanks, doing it now.