Author: Copyright � 2006, Serg153
serg153xo

This script functions as a visual price-action analysis tool designed to map out significant price levels and "zones" on a trading chart. Instead of simply following every minor movement in the market, it focuses on identifying structural boundaries based on specific price ranges.

Core Logic and Functionality

The script operates through a two-stage logic process to interpret historical data and draw relevant visual markers:

1. Structural Analysis Phase The tool begins by scanning the historical price data starting from the beginning of the chart history. It looks for significant "breakouts" where the price moves beyond a pre-defined distance (the "Box Size").

  • It tracks how the price climbs or falls relative to these boundaries.
  • By analyzing these movements, it identifies key milestones and shifts in market direction.
  • This phase essentially calculates the "skeleton" of the price movement to determine where important price levels were established.

2. Visual Mapping Phase Once the significant price points are identified, the script performs a second pass to draw visual boxes directly onto your chart.

  • Dynamic Drawing: For every significant price movement detected, the script generates two types of rectangles. One is placed in the background for structural reference, and another is placed in the foreground for high visibility.
  • Color Coding: The tool distinguishes between upward and downward momentum:
    • Upward movements are highlighted using a specific primary color (Red).
    • Downward movements are highlighted using a secondary color (Yellow).
  • Visual Alignment: These boxes are drawn to correspond with the timeframes where the price breached the calculated boundaries, providing a visual history of where the market "stretched" or "expanded."

Summary for the User

Essentially, this script acts as an automated "highlighter" for your chart. It filters out the noise of minor price fluctuations and draws distinct boxes over periods of significant price expansion. This allows you to see at a glance where historical price levels were established and which directions those movements were headed, helping you visualize market structure more clearly.

11 Views
0 Downloads
0 Favorites
serg153xo
//+------------------------------------------------------------------+ 
//| Serg153xo                                                        |  
//+------------------------------------------------------------------+ 
#property copyright "Copyright © 2006, Serg153"
#property indicator_chart_window
//---- input parameters 
extern int RazmBox=20;
//----
int i,p,Lt,Lt1,Tb;
double RazmBoXO, Cnac;
int VsegoBarov;
//----
extern color ColorUp  =Red;      // Öâåò âîñõîäÿùåé ñâå÷è
extern color ColorDown=Yellow;   // Öâåò íèñõîäÿùåé ñâå÷è
//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
  int deinit() 
  {
     for(i=0; i<99999; i++) 
     {
      ObjectDelete("BodyXO"+i);
      ObjectDelete("BodyX"+i);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+ 
//| Êðåñòèêè Íîëèêè                                                  | 
//+------------------------------------------------------------------+ 
int start()
  {
   RazmBoXO=RazmBox*Point;
   VsegoBarov=Bars - 1;
   Lt=0;
   Cnac=Open[VsegoBarov];
   Tb=0;
   p=0;
   // 1 ïðîãîí ïîäñ÷¸ò âñåõ áàðîâ
     for(i=VsegoBarov; i>=1; i--)
     { 
        p=0;
        while(High[i]>=Cnac + RazmBoXO) 
        {
         if (Tb==0) Lt++;
         Cnac+=RazmBoXO; p++; Tb=1;
        }
      if (p > 0) continue;
        while(Low[i]<=Cnac - RazmBoXO) 
        {
         if (Tb==1) Lt++;
         Cnac-=RazmBoXO; Tb=0;
        }
     }
   Lt=10 + Lt*2;
   // ñäâèãàåì âñå áàðû âïðàâî
   // 2 ïðîãîí ðàçðèñîâêà áàðîâ
   Cnac=Open[VsegoBarov];
   Lt1=0;
     for(i=VsegoBarov; i>=1; i--)
     {
       p=0;
        while(High[i]>=Cnac + RazmBoXO) 
        {
         if (Tb==0) Lt-=2;
         Lt1++;
         ObjectCreate("BodyXO" + Lt1, OBJ_RECTANGLE, 0, 0,0, 0,0);
         ObjectSet("BodyXO" + Lt1, OBJPROP_TIME1, Time[Lt] );
         ObjectSet("BodyXO" + Lt1, OBJPROP_PRICE1, Cnac);
         ObjectSet("BodyXO" + Lt1, OBJPROP_TIME2, Time[Lt-2]);
         ObjectSet("BodyXO" + Lt1, OBJPROP_PRICE2, Cnac+RazmBoXO);
         ObjectSet("BodyXO" + Lt1, OBJPROP_STYLE, STYLE_SOLID);
         ObjectSet("BodyXO" + Lt1, OBJPROP_BACK, True);
         ObjectSet("BodyXO" + Lt1, OBJPROP_COLOR, ColorUp);
         ObjectCreate("BodyX" + Lt1, OBJ_RECTANGLE, 0, 0,0, 0,0);
         ObjectSet("BodyX" + Lt1, OBJPROP_TIME1, Time[Lt] );
         ObjectSet("BodyX" + Lt1, OBJPROP_PRICE1, Cnac);
         ObjectSet("BodyX" + Lt1, OBJPROP_TIME2, Time[Lt-2]);
         ObjectSet("BodyX" + Lt1, OBJPROP_PRICE2, Cnac+RazmBoXO);
         ObjectSet("BodyX" + Lt1, OBJPROP_STYLE, STYLE_SOLID);
         ObjectSet("BodyX" + Lt1, OBJPROP_BACK, False);
         ObjectSet("BodyX" + Lt1, OBJPROP_COLOR, Blue);
         Cnac+=RazmBoXO;
         Tb=1; p++;
        }
      //*************************************************************** 
      if (p > 0) continue;
        while(Low[i]<=Cnac - RazmBoXO) 
        {
         if (Tb==1) Lt-=2;
         Lt1++;
         ObjectCreate("BodyXO" + Lt1, OBJ_RECTANGLE, 0, 0,0, 0,0);
         ObjectSet("BodyXO" + Lt1, OBJPROP_TIME1, Time[Lt]);
         ObjectSet("BodyXO" + Lt1, OBJPROP_PRICE1, Cnac);
         ObjectSet("BodyXO" + Lt1, OBJPROP_TIME2, Time[Lt-2]);
         ObjectSet("BodyXO" + Lt1, OBJPROP_PRICE2, Cnac-RazmBoXO);
         ObjectSet("BodyXO" + Lt1, OBJPROP_STYLE, STYLE_SOLID);
         ObjectSet("BodyXO" + Lt1, OBJPROP_BACK, True);
         ObjectSet("BodyXO" + Lt1, OBJPROP_COLOR, ColorDown);
         ObjectCreate("BodyX" + Lt1, OBJ_RECTANGLE, 0, 0,0, 0,0);
         ObjectSet("BodyX" + Lt1, OBJPROP_TIME1, Time[Lt] );
         ObjectSet("BodyX" + Lt1, OBJPROP_PRICE1, Cnac);
         ObjectSet("BodyX" + Lt1, OBJPROP_TIME2, Time[Lt-2]);
         ObjectSet("BodyX" + Lt1, OBJPROP_PRICE2, Cnac-RazmBoXO);
         ObjectSet("BodyX" + Lt1, OBJPROP_STYLE, STYLE_SOLID);
         ObjectSet("BodyX" + Lt1, OBJPROP_BACK, False);
         ObjectSet("BodyX" + Lt1, OBJPROP_COLOR, Blue);
         Cnac-=RazmBoXO; Tb=0;
        }
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments