Profile Picture

Trying to work with a subsection of the Highs ISeries

Posted By CaZeek 2 Years Ago
Message
Posted Wednesday December 16 2015
Hello,

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:
ISeries bars;
for (int i = 0; i < (High.Count); i++)
bars.Add(High.LookBack(Bars.Count - i));


Thanks in advance!

Posted Thursday December 17 2015
FYI

I solved this using the Shift indicator.
ie:
nDayLow = new Lowest(NDayEntry,Low);
shiftLow = new Shift(1);
shitLow.SetInputs(nDayLow);


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems