_MarketPrice w-Daily Open

Download script
_MarketPrice w-Daily Open

This tool is designed to provide traders with a clear, real-time visual dashboard directly on their trading charts. It simplifies market data by displaying four essential price metrics in a centralized, easy-to-read layout, removing the need for the trader to constantly look at the quote window or manually calculate specific values.

Key Functionalities

Real-Time Price Tracking The indicator identifies and displays the current "Ask" (the price to buy) and "Bid" (the price to sell). These are presented prominently on your screen, allowing for immediate recognition of the current market state at a glance.

Dynamic Color Feedback To help with quick decision-making, the tool features an intelligent color-coding system. It monitors the movement of the prices:

  • When the price moves upward compared to its previous position, the text changes to green.
  • When the price moves downward, the text shifts to red. This provides an instant visual cue regarding the immediate direction of market momentum.

Spread Calculation One of the most practical features of this tool is the automated calculation of the "Spread." The script takes the difference between the Ask and Bid prices and converts it into a readable format. This allows traders to monitor transaction costs in real-time without performing manual arithmetic.

Daily Open Reference The indicator also tracks the "Daily Open" price. By displaying the price at which the market began for the current day, it provides a constant benchmark. This helps traders quickly assess whether the current price is trading significantly above or below the day's starting point.

Customization and Display

The tool is highly flexible regarding its appearance on your workspace:

  • Positioning: You can choose which corner of the chart (Upper Left, Upper Right, Lower Left, or Lower Right) the information should appear in.
  • Typography: Users can customize the font type, size, and colors to ensure the dashboard is legible and fits their personal trading aesthetic.
  • Cleanliness: The script is designed to automatically clean up these labels when you remove the indicator, ensuring your chart remains tidy and free of "ghost" objects.
Price Data Components
Series array that contains open prices of each bar
20 Views
0 Downloads
0 Favorites
_MarketPrice w-Daily Open
//+------------------------------------------------------------------+
//| Magnified Market Price.mq4        ver1.4             by Habeeb   |
//+------------------------------------------------------------------+

#property indicator_chart_window

  extern string note1 = "Change font colors automatically? True = Yes";
  extern bool   Bid_Ask_Colors = True;
  extern string note2 = "Default Font Color";
  extern color  FontColor  = Black;
  extern color  FontColor2 = Black;
  extern string note3 = "Font Size";
  extern int    FontSize=20;
  extern string note4 = "Font Type";
  extern string FontType="Times new roman";
  extern string note5 = "Display the price in what corner?";
  extern string note6 = "Upper left=0; Upper right=1";
  extern string note7 = "Lower left=2; Lower right=3";
  extern int    WhatCorner=1;

  double       Old_Price;
  double       Old_Price2;
  double       SpreadPrice;
  double       DailyOpen;
  int          pf;

int init()
  {
   if(Digits==2 || Digits==4) pf=1; else pf=10;
   return(0);
  }

int deinit()
  {
  ObjectDelete("Market_Price_Label");
  ObjectDelete("Market_Price_Label2");
  ObjectDelete("Market_Price_Label3");
  ObjectDelete("Daily_Open_Label");
  
   
  
  return(0);
  }

int start()
  {
   if (Bid_Ask_Colors == True)
   {
    if (Bid > Old_Price) FontColor = LawnGreen;
    if (Bid < Old_Price) FontColor = Red;
    if (Ask > Old_Price2) FontColor2 = LawnGreen;
    if (Ask < Old_Price2) FontColor2 = Red;
    Old_Price = Bid;
    Old_Price2 = Ask;
    SpreadPrice = (Ask-Bid)/Point/pf;
   }
   
   DailyOpen = iOpen(NULL,PERIOD_D1,0);
   

   string Market_Price2 = DoubleToStr(Ask,Digits);
   string Market_Price = DoubleToStr(Bid,Digits);
   string Market_Spread = DoubleToStr(SpreadPrice,0);
   string DOpen = DoubleToStr(DailyOpen,Digits);
    
  

   ObjectCreate("Market_Price_Label2", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Market_Price_Label2", "A " + Market_Price2, FontSize, FontType, FontColor2);
   ObjectSet("Market_Price_Label2", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Market_Price_Label2", OBJPROP_XDISTANCE, 2);
   ObjectSet("Market_Price_Label2", OBJPROP_YDISTANCE, 10);
   
   ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Market_Price_Label", "B " + Market_Price, FontSize, FontType, FontColor2);
   ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 2);
   ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, (FontSize+20));

   ObjectCreate("Market_Price_Label3", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Market_Price_Label3","S " + Market_Spread, FontSize, FontType, Green);
   ObjectSet("Market_Price_Label3", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Market_Price_Label3", OBJPROP_XDISTANCE, 2);
   ObjectSet("Market_Price_Label3", OBJPROP_YDISTANCE, (FontSize+50));
   
   ObjectCreate("Daily_Open_Label", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Daily_Open_Label","D " + DOpen, FontSize, FontType, Green);
   ObjectSet("Daily_Open_Label", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Daily_Open_Label", OBJPROP_XDISTANCE, 2);
   ObjectSet("Daily_Open_Label", OBJPROP_YDISTANCE, (FontSize+80));

   
   
   
  }
  

Comments