wajdyss_Candle_Length_indicator_v1

Download script
Author: Copyright 2008 Wajdyss
wajdyss_Candle_Length_indicator_v1

This tool is a specialized visual indicator designed for the MetaTrader 4 trading platform. Its primary purpose is to provide real-time information regarding the size of price movements on your chart by calculating and displaying the specific length of a price candle.

Core Functionality

The script focuses on measuring volatility and range. It identifies the "high" and "low" points of the current candle (the highest price reached and the lowest price hit during a specific timeframe) and calculates the total distance between them. This distance is then converted into a numerical value representing the price points covered.

Visual Presentation

Instead of appearing as a complex line or shape on the graph, the script functions as an on-screen information display. It generates several text labels that stay fixed on your chart window to provide quick reference data:

  • Header Information: It displays identifying labels, including the name of the indicator and the creator's contact information, ensuring you know exactly which tool is active on your screen.
  • Dynamic Data Display: The core feature is a live text label that constantly updates to show the "Candle Length." As the price moves up or down during the current period, this number changes instantly, allowing you to see the exact magnitude of the current price action at a glance.

How it Benefits the User

This script is designed for traders who need to monitor market volatility quickly. By providing the numerical length of a candle directly on the screen, it removes the need to manually calculate the difference between highs and lows. It serves as a clean, real-time dashboard element that helps you gauge how much "room" has been covered in the current trading session.

Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
13 Views
0 Downloads
0 Favorites
wajdyss_Candle_Length_indicator_v1
//+------------------------------------------------------------------+
//|                                      wajdyss_H_L_C_indicator.mq4 |
//|                                           Copyright 2008 Wajdyss |
//|                                                wajdyss@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2008 Wajdyss"
#property link      "wajdyss@yahoo.com"

#property indicator_chart_window
extern int Candle=1;
 int TextSize=14;
 extern color TextColor1=Black;
 extern color TextColor2=Red;
 extern color TextColor3=Blue;
 extern color TextColor4=Black;
 color TextColor5=Chartreuse;
 color TextColor6=DodgerBlue;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
  Comment("");
 ObjectDelete("a label");
 ObjectDelete("b label");
 ObjectDelete("c label");
 ObjectDelete("d label");
 ObjectDelete("e label");
 ObjectDelete("f label");


   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
  double H=iHigh(Symbol(),PERIOD_D1,0);
  int H2=H;
  //a
          if(ObjectFind("a label") != 0)
   {
      ObjectCreate("a label", OBJ_LABEL, 0,0,0);
      ObjectSetText("a label","ÈÓã Çááå ÇáÑÍãä ÇáÑÍíã" , TextSize, "Arial", TextColor1);
      ObjectSet("a label", OBJPROP_XDISTANCE,350);
     ObjectSet("a label", OBJPROP_YDISTANCE,0);
   }
   
   //b
      if(ObjectFind("b label") != 0)
   {
      ObjectCreate("b label", OBJ_LABEL, 0,0,0);
      ObjectSetText("b label","wajdyss_Candle_Length_indicator"  , TextSize, "Arial", TextColor2);
      ObjectSet("b label", OBJPROP_XDISTANCE,280);
     ObjectSet("b label", OBJPROP_YDISTANCE,25);
   }
   
   // c

   
      if(ObjectFind("c label") != 0)
   {
      ObjectCreate("c label", OBJ_LABEL, 0,0,0);
      ObjectSetText("c label","wajdyss@yahoo.com"  , TextSize, "Arial", TextColor3);
      ObjectSet("c label", OBJPROP_XDISTANCE,335);
     ObjectSet("c label", OBJPROP_YDISTANCE,50);
   }
   
 // if (Period()>1440) return(0);
double A=((iHigh(Symbol(),0,Candle)-iLow(Symbol(),0,Candle))/Point);
int AA=A;
   
    ObjectDelete("d label");
      ObjectCreate("d label", OBJ_LABEL, 0,0,0);
      ObjectSetText("d label","Candle Length = "+AA  , TextSize, "Arial", TextColor4);
      ObjectSet("d label", OBJPROP_XDISTANCE,340);
     ObjectSet("d label", OBJPROP_YDISTANCE,75);


 //   ObjectDelete("e label");
   //   ObjectCreate("e label", OBJ_LABEL, 0,0,0);
  //    ObjectSetText("e label","today low = "+DoubleToStr(iLow(Symbol(),PERIOD_D1,0),Digits)  , TextSize, "Arial", TextColor5);
  //    ObjectSet("e label", OBJPROP_XDISTANCE,345);
  //   ObjectSet("e label", OBJPROP_YDISTANCE,100);

//    ObjectDelete("f label");
  //    ObjectCreate("f label", OBJ_LABEL, 0,0,0);
    //  ObjectSetText("f label","today close = "+DoubleToStr(iClose(Symbol(),PERIOD_D1,0),Digits)   , TextSize, "Arial", TextColor6);
  //    ObjectSet("f label", OBJPROP_XDISTANCE,340);
   //  ObjectSet("f label", OBJPROP_YDISTANCE,125);
     
   return(0);
  }

Comments