Round Numbers

Download script
Author: Copyright � 2007, LEGRUPO
Round Numbers

This indicator is designed to provide visual clarity on a trading chart by automatically identifying and highlighting "Round Numbers." In financial markets, round numbers often act as significant psychological levels where traders frequently place orders, leading to increased price action or resistance.

How the Logic Works

The script constantly monitors the most recent price movement to determine the nearest whole-cent (or base currency unit) levels. It performs the following operations:

1. Identifying Key Price Levels The tool calculates two primary "Round Numbers" based on the previous candle's closing price:

  • The Upper Round Number: It rounds the price upward to the nearest whole decimal.
  • The Lower Round Number: It rounds the price downward to the nearest whole decimal.

2. Dynamic Visual Mapping Once these levels are identified, the script automatically draws horizontal lines on your chart so you can see them clearly:

  • Buy Zone (Blue): The tool creates a set of blue lines centered around the rounded upward price level. This helps identify potential areas where buyers might be active.
  • Sell Zone (Red): The tool creates a set of red lines centered around the rounded downward price level. This helps identify potential areas where sellers might be concentrated.

3. Precision Buffer Zones Rather than just placing a single thin line, the script creates a small "buffer zone" around each round number. It places secondary lines slightly above and below the main round number. This visualization allows you to see a concentrated area of interest rather than a single point in price, making it easier to judge the strength of a support or resistance level at a glance.

Summary for Traders

This tool removes the manual work of identifying key psychological prices. By automatically drawing these blue and red zones based on current market conditions, it helps you visualize where the "crowd" might be positioned, allowing for better identification of potential trend reversals or breakout points.

Price Data Components
Series array that contains close prices for each bar
Indicators Used
Moving average indicator
14 Views
0 Downloads
0 Favorites
Round Numbers
//+------------------------------------------------------------------+
//|                                                Round Numbers.mq4 |
//|                                        Copyright © 2008, LEGRUPO |
//|                                           http://www.legrupo.com |
//|                                                     Version: 1.0 |
//| History:                                                         |
//| 1.0 => Release version to the public                             |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2007, LEGRUPO"
#property link      "http://www.legrupo.com"

extern color ColorBuy = Blue;
extern color ColorSell = Red;

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectsDeleteAll();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   double pc_B = (MathCeil((iClose(NULL,0,1)*100))/100);
   double pc_S = (MathFloor((iClose(NULL,0,1)*100))/100);
   double sma_200 = iMA(Symbol(), 0, 200, 0, MODE_SMA, PRICE_CLOSE,0);
   
   ObjectDelete("pc_B_0");
   ObjectDelete("pc_B_1");
   ObjectDelete("pc_B_2");
   ObjectCreate("pc_B_0", OBJ_HLINE, 0, 0, pc_B);
   ObjectCreate("pc_B_1", OBJ_HLINE, 0, 0, pc_B+15*Point);
   ObjectCreate("pc_B_2", OBJ_HLINE, 0, 0, pc_B-15*Point);
   ObjectSet("pc_B_0", OBJPROP_COLOR, ColorBuy);
   ObjectSet("pc_B_1", OBJPROP_COLOR, ColorBuy);
   ObjectSet("pc_B_2", OBJPROP_COLOR, ColorBuy);
   
   ObjectDelete("pc_S_0");
   ObjectDelete("pc_S_1");
   ObjectDelete("pc_S_2");
   ObjectCreate("pc_S_0", OBJ_HLINE, 0, 0, pc_S);
   ObjectCreate("pc_S_1", OBJ_HLINE, 0, 0, pc_S+15*Point);
   ObjectCreate("pc_S_2", OBJ_HLINE, 0, 0, pc_S-15*Point);
   ObjectSet("pc_S_0", OBJPROP_COLOR, ColorSell);
   ObjectSet("pc_S_1", OBJPROP_COLOR, ColorSell);
   ObjectSet("pc_S_2", OBJPROP_COLOR, ColorSell);
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments