test_showNticks

Download script
Author: Ron T
test_showNticks

This technical tool is designed to assist traders in identifying specific momentum shifts and price trends by analyzing the "Typical Price" of a financial asset. Instead of looking at just the closing price, it evaluates the relationship between the high, low, and closing prices of each candle to determine a more balanced view of market movement.

How the Logic Works

The core functionality revolves around measuring the rate of change between consecutive price points. Here is a breakdown of how the script processes this information:

1. Price Calculation The tool calculates a specific value for every historical candle on your chart. This value represents the "Typical Price," which is an average derived from the highest and lowest points reached during that period, combined with the closing price. By using this average, the indicator attempts to smooth out minor fluctuations and provide a clearer picture of the underlying trend.

2. Momentum Detection (The Gap Value) The script relies on a user-defined threshold known as a "Gap Value." This acts as a filter to ensure that the tool only reacts to significant price movements rather than minor, insignificant noise. It looks for specific "jumps" or "drops" in the Typical Price from one candle to the next.

3. Signal Generation The logic continuously compares the current Typical Price to the previous one. It produces two types of visual signals based on the direction and strength of that change:

  • Downward Momentum (Sell Indicators): If the price drops by a margin greater than the designated Gap Value, the script places a specific visual marker on the chart. This indicates a significant downward movement in price momentum.
  • Upward Momentum (Buy Indicators): Conversely, if the price rises by a margin greater than the designated Gap Value, the script places a different visual marker. This highlights a significant upward surge in price momentum.

4. Visual Overlay To help the user visualize these movements, the tool also plots a continuous line representing the Typical Price history across the chart. This allows you to see the overall flow of the market while simultaneously viewing the specific "Buy" and "Sell" markers that trigger when the price moves beyond your chosen sensitivity limits.

Summary for the User

In essence, this tool automates the process of watching for sharp price "breaks." It filters out the "choppiness" of the market and only highlights moments where the price moves aggressively enough to meet your specific criteria, making it easier to identify potential trend reversals or strong momentum shifts at a glance.

Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
test_showNticks
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                           MultiMovingAverage.mq4 |
//+------------------------------------------------------------------+
#property copyright "Ron T"
#property link      "http://www.lightpatch.com"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 White
#property indicator_color3 White

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];


// user input
extern double GapVal=0.0005;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {

   SetIndexStyle(0,DRAW_ARROW);
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexArrow(0,234); //down red
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexArrow(1,233); //up white

   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2, ExtMapBuffer3);
   //SetIndexArrow(2,158);  //marker blue

   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   int i;
   
   for( i=0; i<Bars; i++ ) ExtMapBuffer1[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer2[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer3[i]=0;

   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double curTYP=0;
   double oldTYP=0;
   double change=0;

   int pos=Bars/5;
   
   // Print ("Start SHOW5TICKS with bars=",pos);

   while(pos>=0)
     {
      oldTYP=curTYP;
      curTYP=(High[pos]+Low[pos]+Close[pos])/3;
      change=curTYP-oldTYP;

      if ( change < ( GapVal * (-1) ) )
        {
         ExtMapBuffer1[pos]=curTYP;  //up white
         ExtMapBuffer2[pos]=0;
         //Print ("would SELL here ",CurTime());
        }

      if ( change > GapVal )
        {
         ExtMapBuffer1[pos]=0;
         ExtMapBuffer2[pos]=curTYP;  //down red
         //Print ("would BUY  here ",CurTime());
        }

      // marker for all typicals so they're visual
      ExtMapBuffer3[pos]=curTYP;  //marker blue

 	   pos--;
     }

   return(0);
  }
//+------------------------------------------------------------------+

Comments