This is a "trend control function", a graphical panel created in the form of an indicator. It consists of four instances of a proprietary trend indicator, as well as the RVI and RSI indicators. It generates a trade signal. It passes signals via buffer 0, index 0. 1 corresponds to UP, -1 corresponds to DOWN.
The TF, Periods and Differ values are set for each indicator individually. In addition, the Shift1 and Shift2 values are set for the RVI and RSI indicators, which allow obtaining the difference in the curve's levels on segments of the specified length.
The trend indicators can be disabled by setting TF=0, RVI and RSI are disabled by buttons. The values of disabled indicators are not taken into account.
The graphical interface can be hidden by a button. The function will use the values that were last entered in the graphical interface. The graphical interface has the highest priority, after making changes to the input parameters or loading a set file, it is necessary to click the Reset button. To remove the indicator, click the Exit button. It will be unloaded, deleting all its graphics.
The ability to use any number of indicators in conjunction with the flexibility of settings allows you to use this function to implement a variety of strategies - from long-term to scalping or pipsing, both in manual trading and as part of Expert Advisors.
The RSI participates in automatic generation of signals only as the difference of values between the shifted indices. The values corresponding to the "overbought" and "oversold" states can only be evaluated visually (in manual or semi-automatic trading). Automatic processing of these states can be harmful. The data provided by the RVI and RSI indicators is also displayed in the disabled state. The values of the RVI indicator are multiplied by 100.
The default values are suitable (approximately) for medium-term trading on instruments similar to USD-JPY 4 Digits.
The settings required for implementing your trading strategy can easily be selected in visual mode of the tester via the graphical interface. The same can be done on the chart of a real account.
- interface_Hidden - the initial state of the interface display on the chart. Can be changed by clicking the button.
- GenTF, BigTF, MidTF, MinTF, RviTF, RsiTF - timeframes set to indicators.
- GenPeriods, BigPeriods, MidPeriods, MinPeriods, RviPeriods, RsiPer - enter the number of periods calculated by the indicators.
- GenDif, BigDif, MidDif, MinDif, RviDif, RsiDif - constants to compare the indicator values with.
- rviShift1 - rviShift2 and rsiShift1 - rsiShift2 - offset of the indicator indices. The indicators return the difference of values in a given segment.
- RVI_ON, RSI_ON - buttons to enable indicators.
- ShiftFromLeft, ShiftFromTop - coordinates of the graphical interface relative to the top left corner of the chart.
In Expert Advisors, the indicator can be controlled in two ways:
- The constants of the indicator's input parameters are defined in the input parameters of the Expert Advisor, optimization in the tester is possible. The request line looks as follows:
double val=iCustom(NULL,0,"Stick", true, /* indicator constants, starting with GenTF */ , 0,0);
- The indicator's input parameters are not defined in the EA, the indicator is controlled through its graphical interface. Optimization in the tester is not possible. The request line looks as follows:
double val=iCustom(NULL,0,"Stick", false, 0,0);
Prefix for deleting the indicator's graphics when unloading the EA: inz_