Profile Picture

Question: Indicator Base Class That Exposes Entire Bar and Can Look Back?

Posted By jamesluong 7 Years Ago

Question: Indicator Base Class That Exposes Entire Bar and Can Look...

Message
QuestionMark Posted Saturday February 20 2010
I'm trying to develop an indicator that will take as an input the entire bar, but also has the ability to lookback on the entire bar.

Based on the Creating an Indicator help file, I identified two potential base classes for this, but neither seems to do the job right.

IndicatorBase class takes as an input the entire bar in the CalcNextValue() method. But there doesn't seem to be a way (from what I can tell) to look back on previous bars without storing them in the indicator class.

SeriesCalculatorBaseWithValues takes an ISeries input, from which you can call the LookBack() method. However, you have to specify which series you want as an input (Open, High, Low, Close). Is there any way to make this take the entire bar?

My indicator will look back on previous highs and lows... thanks
Posted Monday February 22 2010
Inputs are always doubles, so in order to take the entire bar, you'd have to have 4 inputs (OHLC). Are you familiar with setting up an indicator to use multiple inputs? If not, I can give you a quick demonstration.

jamesluong (2/20/2010)
I'm trying to develop an indicator that will take as an input the entire bar, but also has the ability to lookback on the entire bar.

Based on the Creating an Indicator help file, I identified two potential base classes for this, but neither seems to do the job right.

IndicatorBase class takes as an input the entire bar in the CalcNextValue() method. But there doesn't seem to be a way (from what I can tell) to look back on previous bars without storing them in the indicator class.

SeriesCalculatorBaseWithValues takes an ISeries input, from which you can call the LookBack() method. However, you have to specify which series you want as an input (Open, High, Low, Close). Is there any way to make this take the entire bar?

My indicator will look back on previous highs and lows... thanks
Posted Monday March 01 2010
The best thing to do is probably to use IndicatorBase and store the list of previous bars yourself. You can use an RList<BarData> to store the bars easily.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems