PDA

View Full Version : Low Before Entry


GreenTrade
01-21-2008, 01:54 PM
I am trying to add a limit order to take profit after entering a position based on the range before the entry but when I code it just rolls calculation along with new bars. i.e.

double entryLow = MIN(Low, 20)[1];

Since this has no reference to the entry it just returns the lowest low of the previos 20 bars. How do I set this as lowest low of the 20 bars before the entry and keep it static? Thanks.


GT

NinjaTrader_Ray
01-21-2008, 05:31 PM
How about something like:

double EntryLow = MIN(Low, 20)[BarsSinceEntry()];

GreenTrade
01-22-2008, 06:07 AM
That did the trick. Should have known how to do that obvious fix, though. Thanks.


GT