FiveStep-T06R

Download script
Author: Copyright � 2006, HomeSoft-Tartan Corp.
FiveStep-T06R

This trading indicator is designed to identify specific price action reversal points by combining geometric market structure with candlestick momentum analysis. It serves as a visual aid on your chart, marking potential entry points with distinct symbols when the market meets a very specific set of criteria.

Core Logic Overview

The script functions by filtering out general market noise and focusing only on moments where the price "exhausts" its current movement and prepares to turn around. It achieves this by analyzing two primary factors: structural "zig-zag" peaks and the individual characteristics of the most recent candlesticks.

How it Analyzes the Market

The logic operates through the following steps:

1. Structural Identification (ZigZag Integration) The tool relies on an underlying "ZigZag" calculation to identify significant highs and lows. Rather than looking at every tiny price movement, it recognizes the broader "skeleton" of the market trend. It tracks these peaks and troughs to establish the current boundaries of price action.

2. Candlestick Momentum Scanning Once a structural peak or trough is identified, the script performs a microscopic analysis of the last five candles on the chart. It looks for a specific "unanimous" behavior:

  • For Buy Signals: It checks if the candles are consistently moving upward (bullish) or are neutral (Doji), with no downward movements allowed in that five-candle window.
  • For Sell Signals: It checks if the candles are consistently moving downward (bearish) or are neutral, with no upward movements allowed in that five-candle window.

3. Signal Validation A signal is only triggered when both the structural and momentum conditions align perfectly. For example:

  • The Bullish Signal (Lime): The tool detects a price "floor" from the ZigZag logic, confirms that the last five candles show dominant upward momentum (with no bearish candles), and ensures there isn't a conflicting sell signal active.
  • The Bearish Signal (Gold): The tool detects a price "ceiling" from the ZigZag logic, confirms that the last five candles show dominant downward momentum (with no bullish candles), and ensures there isn't a conflicting buy signal active.

Visual Output

When all conditions are met, the indicator places an arrow on your chart:

  • Lime Arrows: Appear above the price at local lows to suggest potential upward momentum.
  • Gold Arrows: Appear below the price at local highs to suggest potential downward momentum.

The logic includes a "safety" filter that prevents conflicting signals from appearing simultaneously, ensuring that the arrows represent clear, distinct directional shifts in the market's behavior.

Miscellaneous
Implements a curve of type %1
18 Views
0 Downloads
0 Favorites
FiveStep-T06R
//+------------------------------------------------------------------+
//|                                                FiveStep-T06R.mq4 |
//+------------------------------------------------------------------+

#property copyright " Copyright © 2006, HomeSoft-Tartan Corp."
#property link      " spiky@transkeino.ru"

#property indicator_chart_window
#property indicator_color1 Lime
#property indicator_buffers 2
#property indicator_color2 Gold
#include <stdlib.mqh>

extern double depth = 20;
extern double deviation = 5;
extern double backstep = 3;
extern double mBar = 50;

double Buffer1[];
double Buffer2[];

int shift = 0;
double ssig = 0;
double bsig = 0;
double zz = 0;
double zzo = 0;
double k = 0;
int i = 0;
double jb = 0;
double js = 0;
double sflag = 0;
double bflag = 0;
double null = 0;

int init()
{
   SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID);
   SetIndexBuffer(0, Buffer1);
   SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID);
   SetIndexBuffer(1, Buffer2);
   return(0);
}
int start()
{

for(shift=Bars-1;shift>=0;shift--){ 
	Buffer1[shift]=0;
	Buffer2[shift]=0;
} 

null=0.00001;

for(shift=mBar;shift>=0;shift--){ 

zz=iCustom(NULL, 0, "ZigZagS",depth,deviation,backstep,mBar,0,shift);
if(zz!=0 && zz!=zzo) zzo=zz;

k=0;js=0;jb=0;
for(i=shift+1;i<=shift+5;i++){ 
if(Close[i]==Open[i]) k=k+1;
if(Close[i]>Open[i]) js=js+1;
if(Close[i]<Open[i]) jb=jb+1;
} 

if(((zz>Open[shift] && zz!=0) || (zzo>Open[shift] && zz==0)) 
                 && js+k==5 && k<=1 && jb==0) { sflag=1;ssig=High[shift]+5*Point;}  else ssig=null;
   
if(((zz<Open[shift] && zz!=0) || (zzo<Open[shift] && zz==0)) 
                 && jb+k==5 && k<=1 && js==0) { bflag=1;bsig=Low[shift]-5*Point;}  else bsig=null;
                 
if(ssig>1) bflag=0; 
if(bsig>1) sflag=0;

if(ssig==null && sflag==1 && zz!=0 && Open[shift]<zz) ssig=High[shift]+5*Point; else ssig=null;
if(bsig==null && bflag==1 && zz!=0 && Open[shift]>zz) bsig=Low[shift]-5*Point; else bsig=null; 


	Buffer1[shift]=ssig;
	Buffer2[shift]=bsig;} 
  return(0);
}

Comments