I was wondering if someone could help me out with some NinjaTrader Strategy coding.
I'm trying to code the following;
Set Stoploss 10 pips below/above the highest/lowest price of the last 96 bars before the entry bar.
For example; the moment the strategy gets me LONG;
Look back 96 bars, get the lowest price, set stoploss 10 pips below this price.
I don't want it to keep counting 96 bars back when I'm in a position. It has to remain at the same spot.
I have tried the following coding, but it doesn't work.
ExitLongStop(0, true, 30000, LowestBar(Close, 96) - 10 * TickSize, "StoppedOutLong", "");
Note that I'm a beginner in coding and this is my first strategy I'm trying to put together.
Many many thanks in advance!

When you ask for help, it might be best if you also include details of what error messages you are getting and when.
Comment