MTF_ang_AZad[Osc]

Download script
MTF_ang_AZad[Osc]

This script functions as a multi-timeframe visual tool designed to help traders analyze market momentum by pulling data from different time periods onto a single chart. Instead of forcing you to switch back and forth between different screens to see what is happening on higher timeframes (like watching a daily trend while looking at a 15-minute chart), this tool automates that process for you.

Core Functionality

The primary logic of the script revolves around "Multi-Timeframe" (MTF) synchronization. It acts as a bridge that reaches out to a specific secondary indicator—the ang_AZad oscillator—and retrieves its values from a timeframe of your choosing.

Here is how the logic works step-by-step:

  • Timeframe Selection: You can define exactly which timeframe you want to monitor. If you leave this setting at the default, the script will simply match the chart you are currently viewing.
  • Data Retrieval: The script automatically scans the history of the selected higher timeframe. It looks for the corresponding time matches to ensure that the data displayed aligns correctly with the current candle on your primary screen.
  • Dual Line Visualization: The tool produces two distinct lines on a separate window below your main price chart.
    • The first line represents the primary oscillator value.
    • The second line represents the secondary (often moving average or smoothed) component of that same indicator.
  • Dynamic Calculation: Rather than just plotting a static image, the script recalculates these values dynamically as new candles form, ensuring that the "big picture" data is updated in real-time relative to your current view.

How it helps the trader

By using this logic, you gain a bird's-eye view of market sentiment without cluttering your workspace. It allows you to see if the overall trend on a larger timeframe is supporting or opposing the price action you see on the smaller timeframe, helping you identify stronger entries and avoid "trading against the grain."

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
MTF_ang_AZad[Osc]
//+------------------------------------------------------------------+
//|                 MTF_ang_AZad(C)[sw]          ang_Zad(C).mq4  ik  |
//|                           Copyright © 2006, ANG3110@latchess.com |
//+------------------------------------------------------------------+

#property  copyright "ANG3110@latchess.com"
//----
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 FireBrick
#property indicator_color2 Blue
//----
extern int TimeFrame=0;
extern int ki = 2;
//extern int Shift=0;

double ExtMapBuffer1[];
double ExtMapBuffer2[];


int init()
  {
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexLabel(0,"MTF_angAZadOsc"+ki+"TF"+TimeFrame+"");
   SetIndexLabel(1,"MTF_angAZad(C)"+ki+"TF"+TimeFrame+"");

   if(TimeFrame==0) TimeFrame = Period();
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator start function                                  |
//+------------------------------------------------------------------+
int start() 

  {
   datetime TimeArray[];
   int    i,shift,limit,y=0,counted_bars=IndicatorCounted();
     
   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
   
   limit=Bars-counted_bars+TimeFrame/Period();
   for(i=0,y=0;i<limit;i++) {
     if (Time[i]<TimeArray[y]) {y++;}   
     ExtMapBuffer1[i]=iCustom(NULL,TimeFrame,"ang_AZad[Osc]",ki,0,y); 
     ExtMapBuffer2[i]=iCustom(NULL,TimeFrame,"ang_AZad[Osc]",ki,1,y);
   }
   return(0);
  }




//+------------------------------------------------------------------+

Comments