DayImpulseOverlay_v2

Download script
DayImpulseOverlay_v2

This tool is designed to provide visual traders with a predictive overlay on their charts, intended to help identify potential price movements by analyzing momentum from previous market activity.

Core Methodology

The logic operates by measuring the "impulse" of the market—specifically, the difference between the opening and closing prices over a set number of time periods (defined by the user). Instead of simply looking at where the price is right now, the script aggregates these historical movements to calculate a specific momentum value.

Key Functions

  • Momentum Calculation: The script pulls data from a secondary calculation method called "Day Impulse 2DD." It takes the net movement of the market over a specific window of time and converts that into a numerical signal.
  • Forward Projection: A unique feature of this tool is its ability to "shift" these signals forward on the chart. By projecting the calculated momentum ahead of the current price, it creates a visual path that traders can use to gauge potential direction.
  • Dynamic Updating: The script includes a toggle that allows the user to choose between a "live" environment and a "frozen" view. When enabled for live updates, the indicator constantly recalculates based on every new tick of price movement, ensuring the signal stays current with the market's immediate velocity.
  • Signal Visualization: The primary output is a magenta line drawn directly on the main chart. It combines the current closing price with the calculated impulse to create a visual trend line that helps traders identify whether the current momentum suggests a continuation or a potential reversal.

Important Usage Note

The logic is designed to highlight trends based on past behavior; however, because the calculations are updated in real-time, the "future" signals shown on the chart are fluid. They represent a mathematical projection of current momentum rather than a guaranteed price target, as market conditions can change instantly.

Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
DayImpulseOverlay_v2
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

/*
 * Filename:    DayImpulseOverlay.mq4
 * Author:      DriverDan, based on the original by Tartan at the link below
 * Date:        Nov 3, 2005
 *
 * Description: This is Day Impulse overlaid on the main chart. Requires DayImpulse2DD.
 *
 *              Sums the close - open for the past "per" bars and shifts it forward
 *              "drawShift" bars. Sometimes works well at predicting movement.
 *
 *              Signal2 is just the current bar's close - open shifted "drawShift"
 *              periods forward. This is what you see as the main signal draws. It
 *              isn't updated as time moves forward so that you have something to look
 *              back on.
 *
 *              WARNING: Looking at past bars will be deceiving. It may look like it
 *              predicts perfectly on some pairs but remember that it is constantly
 *              updated. The most accurate live bar is the current one.
 *
 *              The future is not set.
 *
 * Version:     2DD
 *              Released by DriverDan
 *              Almost all of the code has been changed or rewritten.
 *              Added Signal2.
 *
 *              1.1
 *              Released by DriverDan
 *              Fix horrible style, removed extra buffer, changed to draw from the
 *              beginning, added MA, and fixed gaps in signal.
 *
 *              1.0
 *              Initial release
 *              http://www.arkworldmarket.ru/forum/showthread.php?t=966&page=2&pp=10
 */

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Magenta

extern int per    = 14;  // Period for signal
extern int update = 1;   // 1 = continuously update, 0 = freeze

// Buffers for signals
double drawBuffer[];
   
int init() {
   string title = "DayImplus(" + per + ")";
   
   SetIndexStyle(0, DRAW_LINE, 0, 2);
   SetIndexBuffer(0, drawBuffer);
   
   // Shift everything forward
   SetIndexShift(0, per);
   
   // Titles for each line
   SetIndexLabel(0, "Signal(" + per + ")");
   
   IndicatorShortName(title);
   return(0);
}

int start() {
   int    counted_bars = IndicatorCounted();
   int    shift, i, limit, lim;
   double prevSignal = -1, barClose = -1, imp;

   if(update == 1) {
      imp = iCustom(NULL, 0, "DayImpulse2DD", per, 0, 0, 0, 0, 0, per) * Point;

      barClose = Close[0] - iCustom(NULL, 0, "DayImpulse2DD", per, 0, per) * Point;

      // Loop through and calculate the signals. Everytime this runs we recalculate the
      // current and all future signals. The future is not set :)
      for(shift = per - 1; shift >= 0; shift--) {
         imp = iCustom(NULL, 0, "DayImpulse2DD", per, 0, shift) * Point;
         
         drawBuffer[shift] = barClose + imp;
      }
   }
      
   return(0);
}

Comments