PDA

View Full Version : Retrieving the High/Lows of a Previous Move


TAJTrades
12-09-2007, 10:44 AM
I'm hoping that there is a simpler way of retrieving the High/Lows of a move. As an example use a simple MA CrossOver. I want to be able to retrieve the the High and Low of the last time the MA was in Up mode even though the MA's have crossed into down mode. The next time the MA's go into Up mode I can retrieve the High/Low from the previous Up mode.

I have written this before in EsignalScript (EFS uses Java) and really don't want to have to recreate it in C#.

So here is hoping that there is a simple combination of commands!!!!!

HELP. PLEASE.

TJ

NinjaTrader_Josh
12-09-2007, 11:50 AM
Check out the MRO function.
http://www.ninjatrader-support.com/HelpGuideV6/MostRecentOccurenceMRO.html

TAJTrades
12-10-2007, 04:36 PM
OK I have been working with the MRO command but not having much luck.

I am trying to determine the number of bars ago that the EMA10 CrossedAbove the EMA20. Am using 100 bars to look back. What is wrong with the following code?

int barsAgo = MRO(delegate {return CrossAbove(EMA(10), EMA(20), 100);}, 100, 1);
if (barsAgo > -1)
Print("The last EMA CrossAbove was " + barsAgo + " Bars Ago");






Check out the MRO function.
http://www.ninjatrader-support.com/HelpGuideV6/MostRecentOccurenceMRO.html

NinjaTrader_Josh
12-10-2007, 11:49 PM
Try this
int barsAgo = MRO(delegate {return CrossAbove(EMA(10), EMA(20), 1);}, 100, 1);
The MRO function should do the 100 bar lookback. I don't think you need the CrossAbove to lookback 100 also.