0_IndInverse

Download script
Author: Copyright � 2006, ...
0_IndInverse

Overview

The IND Inverse script is a specialized technical analysis tool designed to help traders identify potential trend reversals and momentum shifts by analyzing price action relative to historical extremes. It operates by calculating a customized volatility index that reacts to the distance between the highest highs and lowest lows over a specific timeframe.

How the Logic Works

1. Range and Amplitude Calculation The script begins by scanning a set amount of historical price data (the "lookback period"). It identifies the highest price point (High) and the lowest price point (Low) reached during this time. By subtracting the low from the high, it determines the total "amplitude" or price range of the market movement.

2. Relative Position Scoring Once the amplitude is established, the script calculates where the current closing price sits within that range. It essentially measures how far the price has traveled toward the top or bottom of its recent boundaries. This value is then scaled by a user-defined period to create a normalized numerical score. This score represents the "momentum" or "intensity" of the current move compared to the historical volatility.

3. Trend Detection and Signal Generation The core intelligence of the script lies in how it interprets these scores:

  • Trend Continuity: The script looks for instances where the momentum score crosses the zero line (moving from positive to negative or vice versa).
  • Reversal Identification: By comparing current scores with previous ones, the tool identifies "Inverse" movements. When the momentum shifts significantly enough to cross a threshold, it triggers visual cues on the chart.

Visual Representation

The tool provides three distinct visual layers to help you interpret the market:

  • Trend Lines: A continuous line that tracks the calculated momentum score, showing the strength of the current price movement.
  • Sell/Reverse Signals: Specific markers (arrows) that appear when the momentum indicates a potential downward shift or a reversal from an upward trend.
  • Buy/Reverse Signals: Distinctive markers that signal a potential upward move or a correction from a downward trend.

Summary for Traders

In simple terms, this script filters out market "noise" by focusing on price extremes. Instead of just looking at where the price is now, it looks at where the price was during its most volatile period and tells you whether the current movement is overextended or beginning to turn around. It serves as an early warning system for trend exhaustion.

Miscellaneous
Implements a curve of type %1
6 Views
0 Downloads
0 Favorites
0_IndInverse
//+------------------------------------------------------------------+
//|                                                 IND Inverse.mq4  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, ..."
#property link      "http://www.forex-tsd.com/"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Maroon
#property indicator_color2 Green
#property indicator_color3 Red

//---- input parameters
extern int iPeriod = 1;
extern int cbars = 1000;
//---- buffers
double Buffer[];
double SigBuffer[];
double DirBuffer[];
//----
int last = 0;
//----
//+------------------------------------------------------------------+
//| Init                                                             |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
    IndicatorDigits(Digits + 2);
    SetIndexStyle(0, DRAW_LINE);
    SetIndexBuffer(0, Buffer);
    SetIndexStyle(1, DRAW_ARROW);
    SetIndexBuffer(1, SigBuffer);
    SetIndexEmptyValue(1, 0);
    SetIndexArrow(1, 233);
    SetIndexStyle(2, DRAW_ARROW);
    SetIndexBuffer(2, DirBuffer);
    SetIndexEmptyValue(2, 0);
    SetIndexArrow(2, 234);
//----
    return(0);
  }
//+------------------------------------------------------------------+
//| Parabolic Sell And Reverse system                                |
//+------------------------------------------------------------------+
int start()
  {
    if(last == 0) 
        ArrayInitialize(DirBuffer,0);
    last = Bars;
    int b = 0, i = 0;
    for(i = 0; i <= cbars; i++)
      {
        // Easy to read
        double HD = High[Highest(NULL, 0, MODE_HIGH, (iPeriod* 20), i)];
        double LD = Low[Lowest(NULL, 0, MODE_LOW, (iPeriod* 20), i)];
        double amplitude = HD - LD;
        if(amplitude != 0)
            Buffer[i] = ((Close[i] - (HD - (amplitude / 2))) / amplitude)*iPeriod;
        else
            Buffer[i] = Close[i]*iPeriod;
      }
    double dir = 0;
    for(i = cbars; i >= 0; i--)
      {
        SigBuffer[i] = 0;
        DirBuffer[i] = 0;
        if(Buffer[i]*Buffer[i+1] < 0)
          {
            if(Buffer[i] < 0) 
                DirBuffer[i] = Buffer[i];
            else 
                SigBuffer[i] = Buffer[i];
          }
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments