#00CURRENT PRICE1

Download script
Author: Original code supplied by Kalenzo
#00CURRENT PRICE1

This script is designed as a specialized visual tool for traders who use complex charting layouts. Its primary purpose is to solve a common display issue: when a trader uses heavy technical analysis tools (such as Pivot Points or Murray Math lines), the actual current price can sometimes become obscured by the sheer number of labels, lines, and overlapping data on the main chart.

To resolve this, the script creates a dedicated, clean display area that clearly highlights three essential pieces of information in real-time:

Key Functionalities:

  • Independent Price Tracking: The script extracts specific market data—specifically a smoothed price value (based on an Exponential Moving Average)—and displays it clearly in a separate viewing window. This ensures that no matter how "crowded" your main chart becomes, you always have a clear, unobstructed view of the current price.
  • Real-Time Countdown Timer: One of the core features is the calculation of the remaining time for the current candle (bar). The logic calculates exactly how many minutes and seconds are left before the next market bar closes. This helps traders manage their timing and execute entries or exits more accurately.
  • Dynamic On-Screen Display: Instead of just plotting a line, the script generates stylized text labels on your screen. It dynamically updates these labels to show:
    • The current price value in a prominent red font.
    • A live countdown showing minutes and seconds remaining in the bar in green and blue tones.
    • Clear headings so you can instantly distinguish between the price data and the time data.

Summary for the User: Think of this script as a "Dashboard" overlay. While your main chart handles the complex technical analysis, this tool pulls the most vital information—current price and time remaining—out into a clean, easy-to-read format. It removes the guesswork of trying to see through cluttered lines, providing you with a constant, high-visibility reference point for active trading.

Price Data Components
Series array that contains open time of each bar
Indicators Used
Moving average indicator
15 Views
0 Downloads
0 Favorites
#00CURRENT PRICE1
//+------------------------------------------------------------------+
//|                                                CURRENT PRICE.mq4 |
//|                                                           cja    |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Original code supplied by Kalenzo"
#property link      "bartlomiej.gorski@gmail.com"
#property link      "Modified code by cja"
#property link      "Modified code by xard777"

//Helps to see the current price in a separate window when price is 
//covered by labels from pivot or murrey math lines 

#property indicator_separate_window
#property indicator_buffers 1
double s1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//---- indicators
IndicatorShortName(" ");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
//----
   // this will write ema value, but it can be any value that u want 
   // for eg. iCustom value or value that u got from object like muray math line
   double myFirstValue = iMA(Symbol(),0,1,0,MODE_EMA,PRICE_CLOSE,0);

	double i;
   int m,s,k;
   m=Time[0]+Period()*60-CurTime();
   i=m/60.0;
   s=m%60;
   m=(m-m%60)/60;
   //Comment(m + " minutes " + s + " seconds left to bar end");
   i=NormalizeDouble(i,1);
   for (k=1;k<=Bars-1;k++) s1[k]=0.0000001;
   for (k=1;k<=2;k++) s1[k]=i;
	//(m,Digits-4)

        ObjectCreate("MyLabel30", OBJ_LABEL, WindowFind("SDX"), 0, 0);
        ObjectSetText("MyLabel30",DoubleToStr(myFirstValue,Digits),11, "Arial Black", Red);
        ObjectSet("MyLabel30", OBJPROP_CORNER, 0);
        ObjectSet("MyLabel30", OBJPROP_XDISTANCE, 580);
        ObjectSet("MyLabel30", OBJPROP_YDISTANCE, 2);
        
        ObjectCreate("MyLabel31", OBJ_LABEL, WindowFind("SDX"), 0, 0);
        ObjectSetText("MyLabel31",DoubleToStr(m,-4),11, "Arial Black", LawnGreen);
        ObjectSet("MyLabel31", OBJPROP_CORNER, 0);
        ObjectSet("MyLabel31", OBJPROP_XDISTANCE, 700);
        ObjectSet("MyLabel31", OBJPROP_YDISTANCE, 1);
   
        ObjectCreate("MyLabel32", OBJ_LABEL, WindowFind("SDX"), 0, 0);
        ObjectSetText("MyLabel32",DoubleToStr(s,-4), 11, "Arial Black", LawnGreen);
        ObjectSet("MyLabel32", OBJPROP_CORNER, 0);
        ObjectSet("MyLabel32", OBJPROP_XDISTANCE, 793);
        ObjectSet("MyLabel32", OBJPROP_YDISTANCE, 2);  
   
        ObjectCreate("MyLabel33", OBJ_LABEL, WindowFind("SDX"), 0, 0);
        ObjectSetText("MyLabel33","Mins ", 10, "Arial Black", LightSkyBlue);
        ObjectSet("MyLabel33", OBJPROP_CORNER, 0);
        ObjectSet("MyLabel33", OBJPROP_XDISTANCE, 660);
        ObjectSet("MyLabel33", OBJPROP_YDISTANCE, 3);
   
        ObjectCreate("MyLabel34", OBJ_LABEL, WindowFind("SDX"), 0, 0);
        ObjectSetText("MyLabel34","Secs", 10, "Arial Black", LightSkyBlue);
        ObjectSet("MyLabel34", OBJPROP_CORNER, 0);
        ObjectSet("MyLabel34", OBJPROP_XDISTANCE, 750);
        ObjectSet("MyLabel34", OBJPROP_YDISTANCE, 3);
        
        ObjectCreate("MyLabel35", OBJ_LABEL, WindowFind("SDX"), 0, 0);
        ObjectSetText("MyLabel35","Price", 10, "Arial Black", LightSkyBlue);
        ObjectSet("MyLabel35", OBJPROP_CORNER, 0);
        ObjectSet("MyLabel35", OBJPROP_XDISTANCE, 530);
        ObjectSet("MyLabel35", OBJPROP_YDISTANCE, 3);

//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments