Dazi MTF Stochastics
Stochastics Indicator with the capability to work in higher timeframes (MTF).
This indicator is designed to run on lower timeframes (the timeframe of the chart the indicator is attached to) while it is calculating values from a higher timeframe (the working timeframe).
It has 3 advantages:
- buffer shift corresponds to the working (MTF) timeframe (when using in combination with expert advisor)
- visualize also in backtesting
- any timeframe possible (e.g. H12 or D2)
The parameters are same as the standard indicator but with two additional parameters:
- Timeframe where the indicator shall work (MTF). (additional)
To be selected from the predefined timeframes. Should not be less than the timeframe of the chart the indicator is running, but is forced to be the chart timeframe in case it is.
- Timeframe Factor (additional)
Value by which the selected timeframe is multiplied with. Will be forced to a minimum of "1".
- KPeriod (standard)
- DPeriod (standard)
- Slowing (standard)
The indicator shall be called with iCustom (NULL,0,"di_MTF-Stochastic",....,buffer,shift).
Buffer corresponds to the provided and required buffer. This indicator provides two buffers: the %K-Line (buffer=0) and the %D-Line (buffer=1).
Shift corresponds to the bar - but of the working timeframe.
Example: active chart is on timeframe M1 while the indicator is working on timeframe M15. Then shift 0 returns the current value (%K or %D) of the working timeframe (M15), shift 1 returns the previous value of M15 (value at the last closed bar in M15), shift 2 corresponds to the value at the 2nd closed bar in M15, etc.
Visualize in Backtest
The indicator works fine in visual charts of the strategy tester. Thus it is possible to visualize the values of the indicator and to verify the strategy of the expert advisor while the backtest is ongoing.
The parameter timeframe can only be selected from the predefined timeframes. But it is multiplied by the factor, which makes it possible to work on any timeframe.
When the chart timeframe is M1, while the indicator shall work on M10, then the parameters "timeframe=M1, factor=10" or "timeframe=M5, factor=2" will work.
This may be interesting especially for higher timesframes like H12, D2 or D3.
Example for use with iCustom
Assuming the chart timeframe is M5 and the indicator shall calculate with the parameters KPeriod=5, DPeriod=3, Slowing=3 on timeframe H2 and the expert advisor needs the %K value of the last closed bar of H2, then the function call may be: kv=iCustom(NULL, 0, "di_MTF-Stochastic", PERIOD_H1, 2, 5, 3, 3, 0, 1)