JMASlope_MTF_v1
Download scriptThis tool is designed for traders who need to analyze market trends across different timeframes simultaneously without switching back and forth between charts. Its primary purpose is to take the data from a specific technical analysis tool—the JMASlope—and project its movements onto your current view.
How It Works
The script acts as a "bridge" or a "translator." Instead of just showing you what is happening on your immediate screen (like a 5-minute or 1-hour chart), it reaches out to a different timeframe that you specify in the settings. It then gathers the information from that higher timeframe and displays it as a visual histogram on your current chart.
Key Features
- Multi-Timeframe Analysis: You can view high-level market trends (like Daily or Weekly movements) while staying on a lower timeframe chart for your actual trading execution.
- Visual Representation: The data is displayed as two distinct histograms, typically colored in Green and Red. This allows you to quickly identify upward and downward momentum at a glance.
- Synchronized Data: The script automatically aligns the historical data from the chosen timeframe with your current chart's timeline, ensuring that the visual information remains relevant to the price action you are seeing.
User Requirements
For this tool to function correctly:
- You must have the original JMASlope indicator installed on your platform.
- The script is configured to look for a specific indicator name (defaulting to "JMASlope"). If your version uses a different name, it can be adjusted in the settings.
- It requires that the timeframe you choose to analyze is equal to or larger than the one you are currently viewing. For example, if you are looking at a 1-hour chart, you can view data from the 4-hour chart, but not the 5-minute chart.
In short, this is a visualization utility that simplifies complex multi-timeframe analysis by bringing "big picture" trend data directly into your active workspace.
//+------------------------------------------------------------------+
//| JMASlope_MTF.mq4 |
//| Copyright © 2007, ASystem Group |
//| asystem2000@rambler.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, Asystem2000"
#property link "asystem2000@rambler.ru"
// Ïðîñòîé èíäèêàòîð, êîòîðûé êîòîðûé ïîçâîëÿåò ïîñòðîèòü â ðàçíûõ òàéìôðåéìàõ àíàëîã èíäèêàòîðà JMASlope
// Åñëè ó Âàñ áàçîâûé èíäèêàòîð JMASlope èìååò äðóãîå íàçâàíèå èñïðàâüòå â ïàðàìåòðå Indicator
// Òåîðåòè÷åñêè ýòîò èíèäèêàòîð ìîæåò îáñëóæèòü ëþáîé èíèäèêàòîð è ïîñòðîèòü åãî ãèñòîãðàììó â ðàçíûõ
// òàéìôðåéìàõ.
// Åäèíñòâåííîå óñëîâèå: áàçîâûé èíäèêàòîð äîëæåí èìåòü äâà âõîäíûõ ïàðàìåòðà ñ òèïîì integer
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Red
//---- input parameters
extern int TimeFrame=0;
extern int Length=14;
extern int Phase=0;
extern string Note="Ìîæåòå ïîìåíÿòü èìÿ èíèäèêàòîðà, åñëè íå ñîâïàäàåò";
extern string Indicator="JMASlope";
//---- buffers
double B_Up[];
double B_Dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if (TimeFrame!=0)
{
if (TimeFrame<Period())
{
Alert("Íàñòðàèâàåìûé òàéìôðåéì äîëæåí áûòü áîëüøå òåêóùåãî èëè ðàâåí 0");
deinit();
return(0);
}
}
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,0,0);
SetIndexBuffer(0,B_Up);
SetIndexStyle(1,DRAW_HISTOGRAM,0,0);
SetIndexBuffer(1,B_Dn);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int limit=Bars-counted_bars-1;
int C_time;
int Bar_Shift;
if (limit==0) return(0);
//----
int i=0;
while(i<limit)
{
C_time=Time[i];
Bar_Shift=iBarShift(NULL,TimeFrame,C_time,false);
B_Up[i]=iCustom(NULL,TimeFrame,Indicator,Length,Phase,0,Bar_Shift);
B_Dn[i]=iCustom(NULL,TimeFrame,Indicator,Length,Phase,1,Bar_Shift);
i++;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments