PriceCounter

Download script
PriceCounter

This tool is designed to provide a real-time visual overlay on your trading chart, specifically focused on displaying two key pieces of information: a dynamic price point and a live update counter. Instead of cluttering your workspace with complex graphs or lines, it functions as a clean text display that updates automatically as the market moves.

Key Functional Components

1. Dynamic Price Tracking The script continuously monitors the market to identify a specific moving average price. Rather than showing you the raw price of the last candle, it calculates an Exponential Moving Average (EMA). It then converts this numerical value into a readable text format and displays it clearly on your screen. This allows you to keep a constant eye on a smoothed price trend without having to hover over various indicators.

2. Real-Time Update Counter Alongside the price, the script includes a live "pulse" counter. Every time the market data refreshes or the script executes its logic, this counter increments by one. This serves as a visual confirmation that the tool is active and continuously processing the latest incoming data from the broker.

3. Customizable Visuals The tool is built to be user-friendly and adaptable to your specific trading layout. It allows for several aesthetic customizations:

  • Positioning: You can toggle whether the information appears on the top-left or top-right of your screen.
  • Sizing: You can adjust the font sizes for both the price and the counter independently to ensure they are legible but not intrusive.
  • Color Coding: You can choose specific colors for each piece of text to help them stand out against different chart backgrounds (e.g., light vs. dark modes).

How it Works in Practice

When you load this script, it initializes the necessary labels on your screen. As the market fluctuates, the script runs a continuous loop: it calculates the current moving average, updates the price text, increments the counter, and redraws both elements instantly. When you remove the script from your chart, it is programmed to automatically "clean up" by deleting the text labels, leaving your chart exactly as it was before.

Indicators Used
Moving average indicator
8 Views
0 Downloads
0 Favorites
PriceCounter
// Price and Counter Display
// only string no line no indicator
//

#property indicator_chart_window

extern bool Right_Left = false;
extern color font_price = White;
extern color font_counter = White;
extern int size_price = 20;
extern int size_counter = 10;

int counter1 = 0;


int init()
  {
   return(0);
  }

int deinit()
  {
   ObjectsDeleteAll(0,OBJ_LABEL); 
   return(0);
  }

int start()
  {    
   string PRC1;
   counter1 = counter1 + 1;
   double Price1 = iMA(Symbol(),0,1,0,MODE_EMA,PRICE_CLOSE,0);   
   PRC1 = DoubleToStr(Price1,Digits);

           ObjectCreate("Signalprice", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Signalprice",""+PRC1+"", size_price, "Arial", font_price);
   ObjectSet("Signalprice", OBJPROP_CORNER, Right_Left);
   ObjectSet("Signalprice", OBJPROP_XDISTANCE, 5);
   ObjectSet("Signalprice", OBJPROP_YDISTANCE, 5); 
   
   
              ObjectCreate("updatecount", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("updatecount",""+counter1+"", size_counter, "Arial",font_counter);
   ObjectSet("updatecount", OBJPROP_CORNER,Right_Left );
   ObjectSet("updatecount", OBJPROP_XDISTANCE, 5);
   ObjectSet("updatecount", OBJPROP_YDISTANCE, 40); 

   return(0);
  }

Comments