InnBar_mtf_v1

Download script
Author: Kalenzo
InnBar_mtf_v1

This tool is designed to identify specific price action patterns on your trading chart by monitoring the relationship between consecutive candles. Instead of focusing on complex mathematical formulas, it looks for a visual phenomenon known as an "Inside Bar."

How the Logic Works

The script scans the market history to compare the high and low points of two adjacent candles. It specifically looks for instances where a candle is completely contained within the range of the previous candle. In simpler terms:

  • The Context: It looks at a "parent" candle (the previous one) and the "child" candle (the current one).
  • The Condition: If the highest price reached by the child candle is lower than the parent's high, AND the lowest price reached by the child candle is higher than the parent's low, the condition is met.
  • The Visual Output: When this "nesting" occurs, the script places two distinct dots on your chart. These dots mark the specific boundaries (the high and the low) of that inner candle.

Key Features

  • Multi-Timeframe Awareness: The tool includes logic to ensure it respects the timeframe you are trading. It is designed to adjust its calculations so that the data remains relevant regardless of whether you are looking at a small time interval or a larger one.
  • Visual Markers: Rather than drawing complex lines, it uses colored dots (Magenta and Medium Violet Red) to clearly highlight where these price contractions happen.
  • Automated Scanning: The script automatically cycles through the historical data on your screen, identifying these patterns instantly so you don't have to manually check every candle to see if it sits inside the previous one.

By using this tool, traders can quickly spot periods of market consolidation where the price is "coiled" within a previous range, which is often a precursor to a significant breakout in either direction.

Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
InnBar_mtf_v1
//+------------------------------------------------------------------+
//|                                                    DOSR_Dots.mq4 |
//|                                                          Kalenzo |
//|                                          http://www.fxservice.eu |
//+------------------------------------------------------------------+
//mod InnBar mtf
#property copyright "Kalenzo"
#property link      "http://www.fxservice.eu"
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 MediumVioletRed
#property indicator_width1 2
#property indicator_width2 2
//----
double val1[];
double val2[];
//----
extern int tf=60;
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,val1);
   SetIndexBuffer(1,val2);
   //
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexStyle(1,DRAW_ARROW);
   //
   SetIndexArrow(0,158);
   SetIndexArrow(1,158);
   //
   SetIndexEmptyValue(0,EMPTY_VALUE);
   SetIndexEmptyValue(1,EMPTY_VALUE);
   //
   SetIndexLabel(0,"insideBar Hi");
   SetIndexLabel(1,"insideBar Lo");
   if (tf<Period())tf=Period();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i,bs,limit;
   int counted_bars=IndicatorCounted();
//----
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
//----
   limit=Bars-counted_bars;
   limit=MathMax(limit,tf/Period());
//----
   for(i=0; i<limit; i++)
     {
      bs=iBarShift(Symbol(),tf,Time[i]);
//----
      double H1=iHigh(Symbol(),tf,bs+1);
      double L1=iLow(Symbol(),tf,bs+1);
      //
      double H=iHigh(Symbol(),tf,bs);
      double L=iLow(Symbol(),tf,bs);
//----
      if ((H1>H)&&(L1<L))
        {
         val1[i]=H; val2[i]=L;
        }
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments