Starting to code with ninjatrader (I have good notions of programing, just starting to get used to C# and ninjatrader script editor) I have a question on 2lines of code:
As an exercice to practice coding a strategy I want to enter a long position when the two bars before the current bar are bullish.
Here is my code:
if (High[2]<High[1])
EnterLong(1,@"long_seb");
I execute this code located in the OnbarUpdate() function on each tick.
When I execute it I get trades that are taken even when the two previous bars are bearish and I don't know why.
Also I should have lots of trades since its executing on each ticks but i get only few
Any Help?
Thanks

Comment