TSI Signals_v3

Download script
Author: Copyright � 2005, MetaQuotes Software Corp.
TSI Signals_v3

This tool is designed to act as a visual navigation aid for traders, automatically identifying potential momentum shifts on a price chart. Rather than requiring you to manually interpret complex wavy lines or fluctuating data, the script simplifies the process by highlighting specific "entry points" using clear visual markers.

How it Works

The logic behind this script relies on comparing two distinct layers of market momentum: the TSI (Trade Signal Index) and its corresponding Signal Line. Think of these as the "speed" and "acceleration" of price movement.

The tool scans the historical data of your chosen asset to look for a specific type of interaction between these two lines:

  • Bullish Signals (Upward Momentum): The script looks for a moment where the primary momentum line crosses from below to above its signal line. When this "crossover" happens, it suggests that upward momentum is gaining strength. The tool then places a Light Blue arrow on your chart to highlight this potential move.
  • Bearish Signals (Downward Momentum): Conversely, it watches for the primary momentum line to drop from above to below its signal line. This indicates that downward pressure is taking over. When detected, the script marks the spot with an Orange arrow.

Key Features

  • Visual Clarity: By placing arrows directly on the price candles, the script removes the guesswork of looking at separate windows or overlapping lines. It tells you exactly where the shift occurred in relation to the current price.
  • Customizable Sensitivity: The logic includes several "Input Parameters" that allow you to adjust how quickly or slowly the tool reacts to market changes. You can fine-tune these settings to filter out minor market noise or to capture faster, more aggressive price swings depending on your trading style.
  • Precision Positioning: To ensure the visual markers don't clutter your view of the actual candles, the script includes an "Arrow Shift." This ensures that the signals are placed at a slight, consistent distance from the price, keeping your chart clean and easy to read.

In essence, this tool acts as an automated scout—constantly monitoring the underlying momentum of the market and alerting you visually the moment the trend begins to tilt in a specific direction.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
TSI Signals_v3
//+------------------------------------------------------------------+
//|                                                  TSI Signals.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LightBlue
#property indicator_color2 Orange
//---- input parameters
extern int       First_R=8;
extern int       Second_S=5;
extern int       SignalPeriod=5;
extern int       Mode_Smooth=1;
extern int       ArrowShift=5;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,233);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexLabel(0,"UpArrow");
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,234);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexLabel(1,"DownArrow");
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit,i;
   double curTSI=0.0,prevTSI=0.0,curSignal=0.0,prevSignal=0.0;
   limit=Bars-counted_bars-First_R-Second_S-SignalPeriod;
   for (i=limit;i>=0;i--)
      {
      curTSI=iCustom(NULL,0,"TSI-Osc",First_R,Second_S,SignalPeriod,Mode_Smooth,0,i);
      prevTSI=iCustom(NULL,0,"TSI-Osc",First_R,Second_S,SignalPeriod,Mode_Smooth,0,i+1);
      curSignal=iCustom(NULL,0,"TSI-Osc",First_R,Second_S,SignalPeriod,Mode_Smooth,1,i);
      prevSignal=iCustom(NULL,0,"TSI-Osc",First_R,Second_S,SignalPeriod,Mode_Smooth,1,i+1);
      if ((curTSI>curSignal)&&(prevTSI<prevSignal)) ExtMapBuffer1[i]=Close[i]+ArrowShift*Point;
      if ((curTSI<curSignal)&&(prevTSI>prevSignal)) ExtMapBuffer2[i]=Close[i]-ArrowShift*Point;
      }
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments