|
Posted 2/20/2010 12:15:36
|
|
|
|
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 2/22/2010 08:24:02
|
|
|
|
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 3/1/2010 10:47:12
|
|
|
|
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
|
|
|
|