Posted Wednesday December 16 2015
I'm new to programming, but I've gone through many many hours of tutorials, so I am not totally C# illiterate. Ultimately, I want N-Day highs to graph, but I don't want to include the current high in the calculation. This way if the High.Current is the N-day high, it won't push the Highest graph up until the next bar. In terms of setting up the trade, I am not having a problem, because I can just compare to the LookBack(1) high:
private Highest nDayHigh;
nDayHigh = new Highest(20,High);
if (Close.Current > nDayHigh.LookBack(1));
However, I want the Highest graph for the current bar to reflect the high of the previous N-days (not including the current bar's high itself).
I tried creating a new ISeries with all but the current high using a for loop, but the Add feature doesn't work with ISeries.. so I'm just not sure how to proceed:
for (int i = 0; i < (High.Count); i++)
bars.Add(High.LookBack(Bars.Count - i));
Thanks in advance!
Posted Thursday December 17 2015
I solved this using the Shift indicator.
nDayLow = new Lowest(NDayEntry,Low);
shiftLow = new Shift(1);