TickTime_Ron_v03a

Download script
TickTime_Ron_v03a

This tool is designed to track and visualize the momentum of price movements by analyzing "ticks"—the smallest possible price changes in a market. Instead of looking at large candles or long-term trends, it focuses on the immediate behavior of the market to identify sustained directional pressure.

How the Logic Works

1. Real-Time Tracking The script constantly monitors every new price update (tick) that occurs. It records whether each individual movement is an "up" tick or a "down" tick. By doing this, it creates a chronological history of these tiny movements.

2. Momentum Analysis Window Rather than looking at the entire history of the chart, the tool uses a specific lookback window (defined by the "TicksToConsider" setting). It looks back at a set number of recent ticks to see how many are moving in one direction versus the other.

3. Calculating Percentage Strength The script calculates what percentage of those recent ticks are upward and what percentage are downward. This allows the tool to distinguish between a minor price fluctuation and a significant, consistent move in a single direction.

4. Visual Signaling The tool identifies "strong" moves based on a user-defined threshold (the "PercentOneWay" setting).

  • Bullish Signal: If a high enough percentage of the recent ticks are moving upward, the script places a lime green "x" on the chart.
  • Bearish Signal: If a high enough percentage of the recent ticks are moving downward, the script places a red "x" on the chart.

Summary for the User

Essentially, this script acts as a momentum sensor. It ignores minor noise and only highlights moments where the market shows a clear, dominant preference for a specific direction over a short period. It provides a visual cue of where the immediate "pulse" of the market is heading based on the frequency of price ticks.

7 Views
0 Downloads
0 Favorites
TickTime_Ron_v03a
//+------------+
//| TickTime   |
//+------------+
#property  copyright "Copyright 2008 Ron Thompson"
#property  link      "http://www.forexmt4.com/"

/*
This indicator shows ticks over time
*/

//---- indicator settings
#property  indicator_chart_window

#property indicator_buffers   2

#property indicator_color1  Green
#property indicator_width1    3

#property indicator_color2   Red
#property indicator_width2    3

extern int     TicksToConsider   =  100;
extern double  PercentOneWay     =   66.0;

//---- buffers
//double BG[];  //Green
//double BR[];  //Red

double TickCurr;
double TickPrev;

double tickup;
double tickdn;

double tu[100000];
double td[100000];
int ptr=-1;

// objects 
int uniq=0;


//+-----------+
//| Init      |
//+-----------+
int init()
  {
  
   // delete all of my objects 
   //for(int i=0; i<=65535; i++)
   //  {
   //   ObjectDelete("mytt2"+DoubleToStr(i,0));
   //  }
   uniq=0;
   if(IsTesting())ObjectsDeleteAll();
  
  
   // 233 up arrow
   // 234 down arrow
   // 158 little dot
   // 159 big dot
   // 168 open square
   // 120 box with X

   //SetIndexBuffer(0,BG);  //Green
   //SetIndexStyle(0, DRAW_ARROW);
   //SetIndexArrow(0,120);

   //SetIndexBuffer(1,BR);  //Red
   //SetIndexStyle(1, DRAW_ARROW);
   //SetIndexArrow(1,120);

   Print("Init complete");
  }

//+-----------+
//| DE-Init   |
//+-----------+
int deinit()
  {
   // delete all of my objects 
   //for(int i=0; i<=65535; i++)
   //  {
   //   ObjectDelete("mytt2"+DoubleToStr(i,0));
   //  }
   uniq=0;
   if(IsTesting())ObjectsDeleteAll();

   Print("DE-Init complete");
  }


//+-----------+
//| Each Tick |
//+-----------+
int start()
  {   
   int i;
   string x;
   
   double pctu;
   double pctd;
   
   TickPrev=TickCurr;
   TickCurr=Close[0];
   
   ptr++;
   if(ptr>99999)
     {
      ptr=0;
      for(i=0; i<=100000; i++)
        {
         tu[i]=0;
         td[i]=0;
        }
     }
   
   
   x="XX";
   
   if(TickCurr>TickPrev) 
     { 
      tu[ptr]=1;
      x="UP";
     }
   
   if(TickCurr<TickPrev)
     {
      td[ptr]=1;
      x="DN";
     }

   tickup=0;
   tickdn=0;
   

   for(i=ptr; i>(ptr-TicksToConsider); i--)
     {
      if(tu[i]>0) tickup++;
      if(td[i]>0) tickdn++;
     }

 
   pctu=(tickup/TicksToConsider)*100;
   if( pctu >= PercentOneWay )
     {
      //BG[0]=Close[0];
      ObjectCreate("mytt2"+DoubleToStr(uniq,0), OBJ_TEXT, 0, Time[0], Close[0]);
      ObjectSetText("mytt2"+DoubleToStr(uniq,0),"x",15,"Arial",LimeGreen);
      uniq++;
     }


   pctd=(tickdn/TicksToConsider)*100;
   if( pctd >= PercentOneWay ) 
     {
      //BR[0]=Close[0];
      ObjectCreate("mytt2"+DoubleToStr(uniq,0), OBJ_TEXT, 0, Time[0], Close[0]);
      ObjectSetText("mytt2"+DoubleToStr(uniq,0),"x",15,"Arial",Red);
      uniq++;
     }


   //Comment("101   ptr="+ptr+" tu="+tickup+" pct="+pctu+" td="+tickdn+" pct="+pctd+" "+x);   
   Comment("ptr="+ptr+" pct="+pctu+" pct="+pctd);   

  }//start






Comments