Raznost2_v1

Download script
Author: Yuriy Tokman
Raznost2_v1

This specialized trading indicator is designed to provide a real-time visual summary of price movement by calculating the immediate "gap" or difference between consecutive price bars on your chart. Instead of relying on complex moving averages or lagging indicators, it focuses on the raw transition from the previous market close to the current market open.

Core Logic and Functionality

The tool monitors two specific data points: the closing price of the most recently completed candle and the opening price of the current active candle. By calculating the numerical distance between these two points, the script identifies the immediate momentum of the market.

To make this information easy to read at a glance, the indicator translates these raw numbers into a color-coded visual display on your trading screen:

  • Bullish Movement (Upward): When the current price opens higher than the previous price closed, the indicator displays an "up" status in Red.
  • Bearish Movement (Downward): When the current price opens lower than the previous price closed, the indicator displays a "down" status in Lime.
  • Neutral Movement (Flat): If there is no change between the previous close and the current open, it identifies the move as "flet" (flat) and displays the information in Blue.

Visual Presentation

The script creates two distinct text labels on the chart to ensure clarity:

  1. The Directional Label: This tells you the nature of the movement (Up, Down, or Flat).
  2. The Magnitude Value: This displays the actual numerical difference in points, allowing you to see exactly how much the price jumped or dropped during the transition.

By providing this instantaneous feedback, the tool helps traders quickly identify "gaps" or immediate reactions in price action as they occur, assisting in the evaluation of market volatility and direction without cluttering the workspace with unnecessary technical lines.

Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each bar
15 Views
0 Downloads
0 Favorites
Raznost2_v1
//+------------------------------------------------------------------+
//|                                                      Raznost2.mq4 |
//|                                                       TokmanYuriy |
//|  13 ñåíòÿáðÿ 2008 ãîäà                      yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   ObjectCreate("signal",OBJ_LABEL,0,0,0,0,0);
   ObjectCreate("signal2",OBJ_LABEL,0,0,0,0,0);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete ("signal");
   ObjectDelete ("signal2");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    string name ;
    double a = ((iOpen(NULL,0,0))-(iClose(NULL,0,1)))/Point;
    string par = DoubleToStr(a,0);
    
    if     (a>0)  
    {
     name = "  up = ";
     ObjectSetText("signal",name,12,"Tahoma",Red);
     ObjectSetText("signal2",par,12,"Tahoma",Red);
    }
    else if(a<0)  
    {
     name = "down = ";
     ObjectSetText("signal",name,12,"Tahoma",Lime);
     ObjectSetText("signal2",par,12,"Tahoma",Lime);
    }
    else if(a==0) 
    {
     name = "flet = ";
     ObjectSetText("signal",name,12,"Tahoma",Blue);
     ObjectSetText("signal2",par,12,"Tahoma",Blue);
    }
    
   ObjectSet("signal",OBJPROP_XDISTANCE,3);
   ObjectSet("signal2",OBJPROP_XDISTANCE,59);
 
   ObjectSet("signal",OBJPROP_YDISTANCE,12);
   ObjectSet("signal2",OBJPROP_YDISTANCE,12);
                  
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments