• 概述
  • 评论
  • 评论

Dazi MTF RSI

RSI (Relative Strength Index) indicator with the capability to work on 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 three advantages

  • buffer shift corresponds to the working (MTF) timeframe (when using in combination with an Expert Advisor)
  • visualize also in backtesting
  • any timeframe possible (e.g., H12 or D2)


Parameters

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. It 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. It will be forced to a minimum of "1".
  • RSI Period (standard)


Buffer shift

The indicator shall be called with iCustom (NULL,0,"di_MTF-RSI",....,buffer,shift).

Buffer corresponds to the provided and required buffer. This indicator provides only one buffer (the relative strength), so the buffer shall be "0".

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 (MACD or signal) 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.


Any timeframe

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 of use with iCustom

Assuming the chart timeframe is M5 and the indicator shall calculate the relative strength with no shift on closed price for a period of 14 bars on timeframe H2 and the Expert Advisor needs the RSI value of the last closed bar of H2, then the function call may be: v=iCustom(NULL, 0, "di_MTF-RSI", PERIOD_H1, 2, 14, 0, 1)

无评论