MA_TSI_v1

This tool is designed to assist traders by identifying potential entry points in the market by combining two distinct types of technical analysis: trend momentum and oscillator crossovers. Instead of just looking at one piece of data, the script cross-references moving averages with a specialized oscillator to filter out "noisy" signals and confirm stronger market moves.

Core Logic Components

1. Trend Identification (Moving Averages) The script monitors the price action using two different sets of Exponential Moving Averages (EMAs). It looks at both the high and low prices of the candles to determine the overall direction:

  • Fast Trend: A short-term average that reacts quickly to recent price changes.
  • Slow Trend: A long-term average that represents the broader market direction. By comparing these, the script can distinguish whether the current momentum is moving upward (bullish) or downward (bearish).

2. Momentum Filtering (TSI Oscillator) To increase accuracy, the script incorporates a "True Strength Index" (TSI) oscillator. This measures the speed and strength of price movements. The logic specifically looks for "cross-over" events—moments where the oscillator value moves from above a specific threshold to below it (or vice versa). This helps identify when a trend is losing steam or beginning to shift.

How the Signals Are Generated

The tool places visual markers on your chart only when both of the following conditions are met simultaneously:

Sell Signals (Bearish) For a signal to appear, the script requires:

  • Trend Confirmation: The short-term moving averages must be lower than the long-term moving averages.
  • Momentum Shift: The oscillator must cross downward through one of three key levels (the zero line, the +50 level, or the -50 level).

Buy Signals (Bullish) For a signal to appear, the script requires:

  • Trend Confirmation: The short-term moving averages must be higher than the long-term moving averages.
  • Momentum Shift: The oscillator must cross upward through one of three key levels (the zero line, the +50 level, or the -50 level).

Visual Output

The script handles all the heavy mathematical lifting in the background and presents the results as clear visual arrows on the chart:

  • Coral Arrows: Indicate potential売り (Sell) opportunities.
  • White Arrows: Indicate potential 買い (Buy) opportunities.

By requiring both a trend confirmation and an oscillator crossover, this logic aims to ensure that you are trading in the direction of the prevailing momentum while also catching the specific "turning points" where that momentum shifts.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
MA_TSI_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+-------------------------------------------------------------------------+
//|MA_TSI.mq4                                                               |
//|http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/ |
//+-------------------------------------------------------------------------+
#property copyright "http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/"
#property link      "http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Coral
#property indicator_color2 White
//---- input parameters
extern int FastMAPeriod=6;
extern int SlowMAPeriod=18;
extern int First_R=4;
extern int Second_S=4;
extern int SignalPeriod=4;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,234);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,233);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int    i;
//---- 
   for (i=Bars-50; i>=0; i--)
      {
      
      double ask    = (MathRound(Ask/Point))*Point;
      double bid    = (MathRound(Bid/Point))*Point;
      double spread = (ask-bid);
      double one    = iMA(Symbol(),0,FastMAPeriod,0,MODE_EMA,PRICE_HIGH,i);
      double two    = iMA(Symbol(),0,FastMAPeriod,0,MODE_EMA,PRICE_LOW,i);
      double three  = iMA(Symbol(),0,SlowMAPeriod,0,MODE_EMA,PRICE_HIGH,i);
      double four   = iMA(Symbol(),0,SlowMAPeriod,0,MODE_EMA,PRICE_LOW,i);
      double LBB0   = iCustom(Symbol(),0,"TSI-Osc",First_R,Second_S,SignalPeriod,1,0,i);
      double LBB1   = iCustom(Symbol(),0,"TSI-Osc",First_R,Second_S,SignalPeriod,1,0,i+1);
      
  if (
      ((one < three) && (two < four)) &&
      ((LBB1 > 50.0000 && LBB0 < 50.0000) ||
       (LBB1 > 0.0000 && LBB0 < 0.0000) ||
       (LBB1 > -50.0000 && LBB0 < -50.0000))
     )
     
     ExtMapBuffer1[i]=High[i]+(spread*2);
      
  if (
      ((one > three) && (two > four)) &&
      ((LBB1 < -50.0000 && LBB0 > -50.0000) ||
       (LBB1 < -0.0000 && LBB0 > -0.0000) ||
       (LBB1 < 50.0000 && LBB0 > 50.0000))
     )
     ExtMapBuffer2[i]=Low[i]-(spread*2);

  }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments