i_dayforce_v1_1

Download script
Author: ExcStrategy
i_dayforce_v1_1

This tool is designed to analyze market momentum by calculating a "Force Index" based on the relationship between price movement and trading volume. Instead of looking at simple price action alone, it interprets how much pressure is behind a move, helping traders identify the strength of current trends.

Core Logic and Functionality

Timeframe Awareness The script includes a built-in safety check to ensure it operates on appropriate timeframes. It is specifically designed for intraday and daily charts; if you attempt to apply it to a timeframe larger than one day (such as weekly or monthly charts), the system will trigger an alert to prevent inaccurate data visualization.

Customizable Smoothing and Pricing The tool allows users to define two primary parameters that shape how the data is visualized:

  • Moving Average Method: You can choose how the data is smoothed out to filter out "noise," making it easier to see the underlying trend.
  • Applied Price: This determines which price point (such as the opening, closing, or average price) the indicator should prioritize when calculating momentum.

Dynamic Day Calculation One of the unique features of this script is how it handles the passage of time. It calculates the number of bars (price candles) that occur within a specific period. By looking back at a predefined number of days, it determines how many candles have passed. This ensures that the "Force" calculation remains consistent regardless of whether you are viewing the chart on a 5-minute, 1-hour, or daily basis.

The Force Index Calculation The final result is plotted as a line in a separate window below your main chart. It measures the intensity of the market:

  • When the indicator moves significantly above the zero level, it suggests strong buying pressure (bullish momentum).
  • When it drops significantly below the zero level, it indicates heavy selling pressure (bearish momentum).
  • By observing where these lines cross or change direction, traders can better understand whether a trend is gaining strength or losing steam.
Indicators Used
Force index
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
15 Views
0 Downloads
0 Favorites
i_dayforce_v1_1
//+------------------------------------------------------------------+
//|                                                     DayForce.mq4 |
//|                                 Copyright 2010-2015, Excstrategy |
//|                                        http://www.ExcStrategy.ru |
//+------------------------------------------------------------------+
#property copyright "ExcStrategy"
#property link      "http://www.ExcStrategy.ru"
#property version   "1.1"
#property description "Force Index"
#property strict
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
#property indicator_width1 1
#property indicator_level1     0.0
#property indicator_levelcolor clrSilver
#property indicator_levelstyle STYLE_DOT
//----
extern int Ma_method=0;
extern int Applied_price=0;
//----
extern int DaysForCalculation=2;
//---- buffers
double Buffer1[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(1);
//---- indicator lines
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Buffer1);
//---- 
   SetIndexLabel(0,"Force");
//---
   DaysForCalculation=DaysForCalculation+1;
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   if(Period()>1400)
     {
      Alert("Error! Period can not be greater than D1");
      return(0);
     }
//----
   int counted_bars=IndicatorCounted();
   int barsday;
   bool rangeday;
   datetime Time1=Time[0],Time2;
//----
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
//----
   for(int i=0; i<limit; i++)
     {
      //----
      rangeday= false;
      barsday = 0;
      //----
      Time2=Time[i]+(1440*60*DaysForCalculation);
      if(Time1<Time2)
         if(i<Bars-MathRound(1500/Period()))
            for(int a=i; a<i+1441; a++)
              {
               //----
               barsday++;
               //----
               if(TimeDayOfYear(Time[a])!=TimeDayOfYear(Time[a+1])) a=i+1442;
              }
      //----
      Buffer1[i]=iForce(NULL,0,barsday,Ma_method,Applied_price,i);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments