DayImplus 1.1
Download scriptThe DayImplus tool is a visual indicator designed to help traders identify momentum and price trends by analyzing the relationship between opening and closing prices over a specific period. Instead of looking at simple price action in isolation, it focuses on the cumulative "gap" or difference between where a candle starts and where it ends.
How it Works
The logic behind this indicator can be broken down into three primary components:
1. Cumulative Price Difference The core of the script calculates the difference between the opening price and the closing price for every candle within a user-defined timeframe (the "Period"). By adding these differences together, the tool measures the overall "push" of the market. If candles are consistently closing higher than they opened, it indicates bullish pressure; if they are closing lower, it shows bearish pressure.
2. Signal Normalization To make this data easier to read on a chart, the script converts these raw price differences into a standardized numerical value. It ensures that the resulting signal is presented clearly, allowing you to see the magnitude of the market's movement without being distracted by the absolute price of the asset.
3. Moving Average Smoothing (Optional) The script includes an optional "Moving Average" feature. When enabled, it takes the raw signals generated from the price differences and applies a smoothing calculation over them. This helps filter out "market noise"—the small, erratic fluctuations that can occur in short periods—providing a cleaner, more stable line that highlights the broader trend.
Visual Representation
The indicator appears in a separate window below your main trading chart. It typically displays two distinct lines:
- The Signal Line: Represents the immediate momentum based on the price differences over the chosen period.
- The Moving Average Line: (If enabled) Provides a smoothed version of that signal to help identify sustained trends.
Key Customization Options
Users can adjust several settings to tailor the tool to their specific trading style:
- Period: Changes how many candles are analyzed to create one signal point (higher numbers provide a broader view; lower numbers are more sensitive).
- Forward Shift: Visually offsets the lines forward on the chart for better visual alignment with current price action.
- Moving Average Settings: Allows you to toggle the smoothing feature on or off and adjust how "slow" or "fast" that average reacts to changes.
//+------------------------------------------------------------------+
//| DayImplus 1.1.mq4 |
//| |
//| Updated by DriverDan |
//| |
//| Versions: |
//| 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 Original Release |
//+------------------------------------------------------------------+
#property link "http://www.arkworldmarket.ru/forum/showthread.php?t=966&page=2&pp=10"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 White
extern int per = 14; // Period for signal
extern int drawShift = 14; // Forward shift
extern int useMA = 1; // 1 = use MA
extern int maPeriod = 34; // Moving average period
double ExtMapBuffer[];
double maBuffer[];
int init() {
string title = "DayImplus(" + per + ")";
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, ExtMapBuffer);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(1, maBuffer);
SetIndexShift(0, drawShift);
SetIndexShift(1, drawShift);
SetIndexLabel(0, "Signal(" + per + ")");
SetIndexLabel(1, "MA(" + maPeriod + ")");
if(useMA == 1) {
title = title + " MA(" + maPeriod + ")";
}
IndicatorShortName(title);
return(0);
}
int start() {
int counted_bars = IndicatorCounted();
int shift, i;
double imp;
//for shift=mBar down to per
for(shift = Bars - counted_bars - 1; shift >= 0; shift--) {
imp = 0;
for(i = shift; i >= shift - per; i--) {
imp = imp + (Open[i] - Close[i]);
}
imp = MathRound(imp / Point);
if(imp != 0) {
imp =- imp;
}
ExtMapBuffer[shift] = imp;
}
if(useMA == 1) {
for(shift = Bars - counted_bars - 1; shift >= 0; shift--) {
if(shift < Bars - maPeriod && shift < Bars - per) {
maBuffer[shift] = iMAOnArray(ExtMapBuffer, 0, maPeriod, 0, MODE_SMA, shift);
}
}
}
return(0);
}
Comments