MTF Bands Level

Download script
Author: Copyright � 2009, Darkkiller and Mladen
MTF Bands Level

This script is designed to provide traders with a multi-timeframe visual analysis tool for their trading charts. Its primary purpose is to allow you to view price bands from a higher timeframe while staying on your current, smaller timeframe chart. This helps in identifying broader market trends and significant support or resistance levels that might be missed when looking at short-term price action alone.

Core Functionality

The tool acts as a "bridge" between different timeframes. Instead of you having to flip back and forth between a 1-hour chart and a 4-hour chart to see the overall trend, this script pulls that information forward and displays it directly on your active screen. It specifically looks for data from another timeframe and maps it onto your current view so you can stay focused on one window while keeping the "big picture" in sight.

Key Features and Logic

  • Multi-Timeframe Synchronization: The logic is built to calculate and display three distinct levels: a moving average/centerline, an upper band, and a lower band. It identifies exactly where these levels sit on a larger timeframe and projects them onto your current chart.
  • Smart Timeframe Filtering: The script includes a safety check. If you attempt to set the source timeframe to be smaller than the one you are currently viewing, the tool will notify you with a message. This ensures the data remains consistent and visually accurate.
  • Customizable Visibility: You have the option to toggle whether the physical lines of the bands are visible on your chart. This allows for a cleaner workspace where you can choose to see the actual trend lines or simply keep the data active in the background.
  • Dynamic Positioning: The script automatically calculates how many bars of historical data need to be processed to ensure that the information shown is perfectly aligned with the current time, providing a smooth and continuous visual experience as the market moves.

Summary for the Trader

Essentially, this tool provides a "top-down" perspective. It allows you to see where the major boundaries are on a large scale (like a daily or 4-hour trend) while you execute your trades on a smaller, more detailed scale (like a 15-minute or 1-hour chart). By visualizing these outer bands, you can better identify when the price is overextended or returning to its average, helping to make more informed entry and exit decisions.

Miscellaneous
Implements a curve of type %1
5 Views
0 Downloads
0 Favorites
MTF Bands Level
//+------------------------------------------------------------------+
//|                                               MTF Band Level.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Darkkiller and Mladen"


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

extern bool   Show_Bands=false;
extern int    TimeFrame  = 0;
extern string TimeFrames = "1,5,15,30,60,240,1440,10080.43200";



double MovingBuffer[];
double UpperBuffer[];
double LowerBuffer[];

int deinit()
  {

   ObjectDelete("dk mtfbandslevel");

   return(0);
  }

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0,MovingBuffer);
   SetIndexBuffer(1,UpperBuffer);
   SetIndexBuffer(2,LowerBuffer);
   
      if (Show_Bands)
   SetIndexStyle(0,DRAW_LINE);
   else
   SetIndexStyle(0,DRAW_NONE);
      if (Show_Bands)
   SetIndexStyle(1,DRAW_LINE);
   else
   SetIndexStyle(1,DRAW_NONE);
      if (Show_Bands)
   SetIndexStyle(2,DRAW_LINE);
   else
   SetIndexStyle(2,DRAW_NONE);

   return(0);
  }
//----
 
//+------------------------------------------------------------------+
//| MTF BBFibo                                                       |
//+------------------------------------------------------------------+
int start()
{
   datetime TimeArray[];
   int    i,limit,y=0,counted_bars=IndicatorCounted();
 
      if ((TimeFrame<Period()) && (TimeFrame>0))
         {
            Comment("Lower timeframe band have been removed from chart");
            return(-1);
         }            
      ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
      limit = MathMax(Bars - counted_bars,MathMax(TimeFrame/Period(),1));   

   for(i=0,y=0;i<limit;i++)
   {
      if (Time[i]<TimeArray[y]) y++; 
         MovingBuffer[i]=iCustom(Symbol(),TimeFrame,"Bands Level",0,y);
         UpperBuffer[i]=iCustom(Symbol(),TimeFrame,"Bands Level",1,y);
         LowerBuffer[i]=iCustom(Symbol(),TimeFrame,"Bands Level",2,y);
         }
   string signature = "dk mtfbandslevel";
   ObjectDelete(signature);
   ObjectCreate( signature, OBJ_LABEL, 0, 0, 0 );
   ObjectSetText(signature,"|dk|",7, "Arial Bold", DimGray);
   ObjectSet( signature, OBJPROP_CORNER, 3 );
   ObjectSet( signature, OBJPROP_XDISTANCE, 10);
   ObjectSet( signature, OBJPROP_YDISTANCE, 1);
   return(0);
  }

Comments