The XMA_TrendSignal indicator defines three states of the market such as flat, trend and very strong trend.
During a flat, the indicator values are set to either -1 or +1 depending on the direction of the movement. In the moderate trend values are -2 or +2, in the strong trend values are -3 and +3. The indicator bars are colored in the corresponding color depending on the force and direction of the trend. The main instrument to measure the trend force in the indicator is the rate of trend change expressed in points. Input parameters for fixing threshold values of this rate:
input uint MA1_Level=20;  // Flat trigger input uint MA2_Level=60;  // Trend trigger   Â
The indicator requires attentive setting for each concrete financial instrument and its timeframe display. For each timeframe it should have own most optimal settings of triggering levels!
The indicator uses SmoothAlgorithms.mqh library classes (must be copied to the terminal_data_folder\MQL5\Include). The use of the classes was thoroughly described in the article “Averaging price series for intermediate calculations without using additional buffers”.
Fig.1 The XMA_TrendSignal indicator