Price_Quote

Download script
Price_Quote

This script serves as an interactive information dashboard for your trading chart, providing a real-time snapshot of current market pricing and historical performance data. Its primary purpose is to display key statistics clearly on the screen without cluttering the price action itself.

Core Functionality

Real-Time Price Tracking The tool monitors the current live market price (Bid) and immediately displays it on your chart. To provide instant context, it calculates the percentage change from the opening price of a specific timeframe (such as a daily or hourly session).

  • Visual Indicators: The script uses color coding to help you identify trends at a glance: gains are displayed in green, while losses are highlighted in red.

Historical Range Analysis Beyond the current price, the tool identifies and displays critical historical milestones based on the period you select. It automatically calculates:

  • The High: The highest price reached during the specified period.
  • The Low: The lowest price reached during that same timeframe.
  • The Range: The total distance (spread) between that high and low, converted into pips for easy readability.

Smart Logic Features

Dynamic Timeframe Recognition The script is designed to be intelligent about how it labels data. Depending on the time period you choose (e.g., minutes, hours, days, weeks, or months), it automatically detects the appropriate unit and updates the display labels accordingly. This ensures that the information remains accurate whether you are day trading small intervals or monitoring long-term trends.

Customizable Layout The script allows for a personalized user experience by letting you define:

  • Placement: You can choose which corner of the chart the data appears in (e.g., Top Right, Bottom Left).
  • Visual Styling: Users can adjust the font type, text size, and specific colors to ensure the information is perfectly legible against different chart backgrounds.

Summary for the Trader

Essentially, this tool acts as a "digital ticker" that summarizes the most important numbers of your current session. It tells you exactly where the price is now compared to where it started, how far it has traveled, and the boundaries of the current market move—all presented in a clean, easy-to-read overlay.

Price Data Components
Series array that contains open prices of each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
3 Views
0 Downloads
0 Favorites
Price_Quote
//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
/*
   Created by Asteris, modified by Cubicrey [March, 2010]
   Website: http://www.indo-investasi.com
   
   Converted to Pivot Star by rkdius [Dec 2016]
*/

#property indicator_chart_window
//--- input parameters
enum lbCorner
  {
   TopLeft=0,       // Top Left
   TopRight=1,      // Top Right
   BottomLeft=2,    // Bottom Left
   BottomRight=3    // Bottom Right
  };
extern ENUM_TIMEFRAMES inpPeriod=PERIOD_D1;    // Period
extern int Shift=0;                                // Shift
extern int xOffset = 5;                          // X-Offset
extern int yOffset = 5;                          // Y-Offset
extern lbCorner LabelCorner = TopRight;          // Label Corner
extern color  ColorUp= MediumSeaGreen;           // Text Color
extern color  ColorDn= Crimson;
extern string Font="Arial";                    // Font
extern int FontSize=22;                         // Font Size
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double BidPrice;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   ObjectMakeLabel("PriceQuoteInfo",xOffset,yOffset);
   ObjectMakeLabel("PriceQuoteMinMax",xOffset,yOffset+FontSize+5);
   return (0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   ObjectDelete("PriceQuoteInfo");
   ObjectDelete("PriceQuoteMinMax");
   return (0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   double xOpen=iOpen(0,inpPeriod,Shift);
   double xHigh= iHigh(0,inpPeriod,Shift);
   double xLow=iLow(0,inpPeriod,Shift);
   double PercentChange=(Bid-xOpen)/xOpen*100;
   string sPcChange="";
   color TextColor;
   int smallfont=FontSize*3/7;
   if(smallfont<6) smallfont=6;
   if(Shift>0)
     {
      xHigh=iHigh(0,inpPeriod,iHighest(0,inpPeriod,MODE_HIGH,Shift,0));
      xLow=iLow(0,inpPeriod,iLowest(0,inpPeriod,MODE_LOW,Shift,0));
     }

   if(PercentChange>0)
     {
      sPcChange=/*" "+CharToStr(236)+*/" +"+DoubleToStr(PercentChange,2);
      TextColor=ColorUp;
     }
   else
     {
      sPcChange=/*" "+CharToStr(238)+*/" "+DoubleToStr(PercentChange,2);
      TextColor=ColorDn;
     }

   double xRange=(xHigh-xLow)*pow(10,Digits-1);
   if(Digits<1)
     {
      xRange=(xHigh-xLow);
     }
   string pivPeriod="M"+IntegerToString(inpPeriod);
   if(inpPeriod>=60) pivPeriod = "H"+IntegerToString(inpPeriod/60);
   if(inpPeriod>=1440) pivPeriod = "D1";
   if(inpPeriod>=10080) pivPeriod = "WK";
   if(inpPeriod>=43200) pivPeriod = "MN";

   ObjectSetText("PriceQuoteInfo",DoubleToStr(Bid,Digits)+" "+sPcChange+"%",FontSize,Font,TextColor);
   ObjectSetText("PriceQuoteMinMax","("+pivPeriod+"/"+IntegerToString(Shift)+") L: "+DoubleToStr(xLow,Digits)+" | H: "+DoubleToStr(xHigh,Digits)+" | R: "
                 +DoubleToStr(xRange,1)+"p",smallfont,Font,Black);

   return (0);
  }
//+--------------------------------------------------------------------------+
//| ObjectMakeLabel:                                                         |
//|                                                            P4L Clock.mq4 |
//| New rewrite by: Pips4life, a user at forexfactory.com                    |
//| 2014-Mar-19: v2_12  P4L Clock.mq4                                        |
//| For lastest version: http://www.forexfactory.com/showthread.php?t=109305 |
//| Previous names: Clock_v1_3.mq4, Clock.mq4, ...                           |
//| Previous version:   Jerome,  4xCoder@gmail.com, ...                      |
///+-------------------------------------------------------------------------+
int ObjectMakeLabel(string n,int xoff,int yoff)
  {
   if(!WindowIsVisible(0)) return(-1);
   ObjectCreate(n,OBJ_LABEL,0,0,0);
   ObjectSet(n,OBJPROP_CORNER,LabelCorner);
   ObjectSet(n,OBJPROP_XDISTANCE,xoff);
   ObjectSet(n,OBJPROP_YDISTANCE,yoff);
   ObjectSet(n,OBJPROP_BACK,false);
   ObjectSet(n,OBJPROP_SELECTABLE,false);
   ObjectSet(n,OBJPROP_HIDDEN,true);
   return(0);
  }// end of ObjectMakeLabel

Comments