TimeFrame question
TimeFrame question
05 Sep 2013, 14:41
Hello,
On the newly added feature for multi time-frames, if I have an indicator which is the daily moving average of a formula that uses H-L-C, I understand that the H-L-C needs to be of the daily series but do I also need to translate the index each time?
Specifically, I am trying to create the Chaikin Oscillator see definition at wikipedia. http://en.wikipedia.org/wiki/Accumulation/distribution_index
So, this is what I came up with according to my understanding. See uploaded algo here:
/algos/indicators/show/329
But, it does not display nothing for certain time-frames.
Any help is greatly appreciated.
Replies
gorin
05 Sep 2013, 17:37
Hi bp,
Thanks for your reply.
I understand what you are saying and your code, I also thought about it and tried it in the code but it still does not produce results under certain time-frames...
I think as far as the definition of the indicator is concerned it shouldn't be based on daily time-frame. The definition of MACD also says 12-day Ema - 26-day ema... but the calculation is not on daily time-frame only.
I will test more cases with such indicators and post here again.
@gorin
bp2012
05 Sep 2013, 16:52
Hi gorin,
I'm still wrapping my head around the multi timeframe functionality as well, but thought I would post a quick comment. It looks like your code is only taking the index differences into consideration when it comes to displaying the results. I think that it also needs to be considered when calculating.
Here is my understanding. Assume that you have 7000 bars available on a 1M chart marketseries. That marketseries represents 7000 minutes. Let's say you pull a marketseries for the Minute5 timeframe. It doesn't automatically pull only the bars that match your current chart time span. It may pull 8000 bars based on the data available. 8000 bars on a 5M series represents a much larger time span than is in your Minute1 chart. Therefore, if you use the index supplied in the calculate method you aren't going to get the results you expect. Hopefully this code snippet will make it clearer. If you put this in cAlgo and set your instance timeframe to Minute, the log will show the time differences between the chart data and the other time frame data.
Good Luck!
- bp
@bp2012