VSAc ROUND NUMBERS

Author: Copyright � 2008, FOREXflash Software Corp.
VSAc ROUND NUMBERS

This script is designed to act as a visual mapping tool for traders who focus on "Round Numbers"—specific price levels where market psychology often causes significant activity. Instead of requiring you to manually identify these key levels, the tool automatically identifies and draws them on your trading chart.

Core Logic & Functionality

Automatic Level Detection The tool constantly monitors the current live market price. It uses a mathematical calculation to find the nearest "thousand" increment based on the asset's pricing. By identifying these major milestones, it highlights areas where large institutional orders or psychological barriers are likely to exist.

Dynamic Visual Mapping Once the script identifies the primary round number, it automatically generates a series of horizontal reference lines both above and below that price point. These lines extend across your chart, providing a clear visual "grid" of key levels. This allows you to see the broader structure of the market at a glance without cluttering your screen with unnecessary data.

Efficiency & Performance To ensure your trading platform remains fast and responsive, the script is programmed with an intelligent update system. It does not need to refresh every single millisecond; instead, it updates its visual markers at sensible intervals. This ensures that the chart stays current while preserving your computer's processing power.

Clean Workspace Management The script includes a built-in cleanup routine. When you remove the tool from your chart, it automatically deletes all the lines it created. This keeps your workspace organized and prevents old, irrelevant lines from staying on your screen after you’ve finished your analysis.

Key Benefits for Traders

  • Psychological Clarity: Quickly see where "Round Numbers" are located to anticipate potential support or resistance.
  • Visual Consistency: The tool uses a consistent color and style (Orange solid lines) to ensure these levels stand out clearly from other price action indicators.
  • Customizable Reach: You can define how many levels above and below the current price you wish to see, allowing you to customize the scope of your technical analysis.
15 Views
0 Downloads
0 Favorites
VSAc ROUND NUMBERS
//+------------------------------------------------------------------+
//|                                           VSA© ROUND NUMBERS.mq4 |
//|                                    Copyright © 2008, FOREXflash. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, FOREXflash Software Corp."
#property link      "http://www.metaquotes.net"
//----
#property indicator_chart_window
//----
extern int     LinesAboveBelow= 150;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   int obj_total= ObjectsTotal();
     for(int i= obj_total; i>=0; i--) 
     {
      string name= ObjectName(i);
      if (StringSubstr(name,0,11)=="[SweetSpot]")
         ObjectDelete(name);
     }
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   static datetime timelastupdate= 0;
   static datetime lasttimeframe= 0;
   // no need to update these buggers too often   
   if (CurTime()-timelastupdate < 600 && Period()==lasttimeframe)
      return(0);
   int i, ssp1, style, ssp;
   double ds1;
   color linecolor;
//----
   ssp1= Bid/Point;
   ssp1= ssp1 - ssp1%1000;
     for(i= -LinesAboveBelow; i<LinesAboveBelow; i++) 
     {
      ssp= ssp1+(i*1000);
        if (ssp%1000==0) 
        {
        }
      ds1= ssp*Point;
      
      drawLine(DoubleToStr(ds1,Digits),Time[1],Time[0],ds1,ds1,1,0,Orange,1);
     }
   return(0);
  }


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void drawLine(string name,datetime tfrom, datetime tto, double pfrom, double pto, int width, int ray, color Col,int type)
  {
   if(ObjectFind(name)!=0)
     {
      ObjectCreate(name, OBJ_TREND, 0, tfrom, pfrom,tto,pto);
//----
      if(type==1)
         ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
      else if(type==2)
            ObjectSet(name, OBJPROP_STYLE, STYLE_DASHDOT);
         else
            ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);
//----
      ObjectSet(name, OBJPROP_COLOR, Col);
      ObjectSet(name,OBJPROP_WIDTH,width);
      ObjectSet(name,OBJPROP_RAY,ray);
     }
   else
     {
      ObjectDelete(name);
      ObjectCreate(name, OBJ_TREND, 0, tfrom, pfrom,tto,pto);

      if(type==1)
         ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
      else if(type==2)
            ObjectSet(name, OBJPROP_STYLE, STYLE_DASHDOT);
         else
            ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);
//----
      ObjectSet(name, OBJPROP_COLOR, Col);
      ObjectSet(name,OBJPROP_WIDTH,width);
      ObjectSet(name,OBJPROP_RAY,ray);
     }
  }

Comments