I'll just start out by saying I am new to Ninja Script and have been trying to read the help guides to understand it. I am trying to move my stop loss if the high since entry of my Long1 signal is above 'X' ticks from my average position price. I think the best way to do this would be using the MAX function.
I tried adding this to the OnBarUpdate() method:
double myEntryHigh = MAX(High, BarsSinceEntry("Long1"));
if (myEntryHigh >= Position.AveragePrice + (6 * TickSize))
This returns the error "The name 'BarsSinceEntry' does not exist in the current context." I also tried this as mentioned in another old thread:
double myEntryHigh = MAX(High, BarsSinceEntry("Long1")[0]);
Same result.
Any help would be greatly appreciated.
Comment