Hey,
I'm new to Ninja Trader scripting. It took me a while to figure out the way things work. If I understand correctly, the code below will draw a the Highs.
protected override void OnStateChange() { if (State == State.SetDefaults){ IsOverlay = true; AddPlot(Brushes.DarkCyan, "High"); } } protected override void OnBarUpdate() { Value[0] = High[0]; }
I would like to determine the local maxima on the price chart. In order to do that I want to do the following:
- loop through the bars
- if the 4 bars at its left and right are lower, set it as a maximum
- return the array of local maxima
Thanks in advance,
Ivan
Comment