I am trying to create a Multitimeframe indicator. I read the Multi-Time Frame & Instruments section and I have some questions.
In the section Initializing Series<T> with an Indicator Method, it is shown how to use a secondary series and how to sync this series:
/* Syncs another Series object to the secondary bar object.
We use an arbitrary indicator overloaded with an ISeries<double> input to achieve the sync.
The indicator can be any indicator. The Series<double> will be synced to whatever the
BarsArray[] is provided.*/
secondarySeries=newSeries<double>(SMA(BarsArray[1],50));
The problem is that the example shown uses SMA as an example. Curiosly, SampleMultiTimeFrame uses SMA too. It seems SMA is used to illustrate everything!
What if I want to use an indicator of mine? I tried to replace SMA with my own indicator, but it didn't work! In the case of SampleMultiTimeFrame, the variable used to store
SMA is of type private SMA. Therefore, I guess the only indicator which will fit here is... well... SMA!
Is there a generic "indicator type" which I can use to hold my own indicator? Or there is another way to tackle the problem? What should I do to make the code work with my own indicator? What if my indicator expects a parameter? What do I have to do to use a parameter?
Thank you,
Claudio
Comment