MTF_Candles
Download scriptThis tool is designed to enhance your trading chart by providing a visual representation of price action from higher timeframes directly onto your current lower timeframe view. It acts as a visual bridge, allowing you to see the "bigger picture" without having to constantly switch between different windows or tabs.
How the Logic Works
The script operates by analyzing data from a specific higher timeframe (which you can customize in the settings). Instead of just showing you a simple line, it creates a comprehensive visual layout on your screen that includes three primary elements:
- Price Range Boxes: The script identifies the high and low prices of the candles from the larger timeframe. It then draws distinct rectangular blocks on your current chart to show you exactly where the price moved within that period. These boxes are color-coded: they turn Light Blue if the higher timeframe candle closed higher than it opened, and Red if it closed lower.
- Opening Price Markers: To help you identify exactly where a specific period began, the script places a horizontal visual marker at the opening price of that higher timeframe candle.
- Closing Price Markers: Similarly, it places another horizontal marker at the closing price of the higher timeframe candle.
Key Features for Traders
By combining these three elements—the high/low range, the open, and the close—the script provides an immediate snapshot of market structure. You can quickly see:
- The overall volatility (the size of the boxes).
- The direction of the trend (via the color changes).
- The specific price levels where the "big money" action occurred on a larger scale.
This allows you to stay focused on your current trading timeframe while remaining aware of the significant boundaries and movements happening on a broader timeline.
//+------------------------------------------------------------------+
//| #MTF Candles.mq4 |
//| Copyright © 2006, Eli Hayun |
//| http://www.elihayun.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Eli Hayun"
#property link "http://www.elihayun.com"
#property indicator_chart_window
//---- input parameters
extern int CandlesTF=240;
extern color UpCandleColor = LightBlue;
extern color DownCandleColor = Red;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
double dif = MathAbs(Time[1] - Time[2]);
int ix = 0;
datetime dtStart = dif * 8 + Time[0];
for (int ii=0; ii<8; ii+=2)
{
ObjectDelete("rect"+ii); ObjectDelete("OTrnd"+ii); ObjectDelete("CTrnd"+ii);
ObjectCreate("rect"+ii,OBJ_TREND, 0, dtStart, iLow(NULL, CandlesTF,ix), dtStart, iHigh(NULL,CandlesTF,ix));
color clr = DownCandleColor; if (iOpen(NULL, CandlesTF,ix) < iClose(NULL, CandlesTF,ix)) clr = UpCandleColor;
ObjectSet("rect"+ii, OBJPROP_COLOR, clr);
ObjectSet("rect"+ii, OBJPROP_WIDTH, 3);
ObjectSet("rect"+ii, OBJPROP_RAY, False);
ObjectCreate("OTrnd"+ii, OBJ_TREND, 0, dtStart, iOpen(NULL, CandlesTF,ix), dtStart-dif, iOpen(NULL,CandlesTF,ix));
ObjectSet("OTrnd"+ii, OBJPROP_WIDTH, 2);
ObjectSet("OTrnd"+ii, OBJPROP_RAY, False);
ObjectSet("CTrnd"+ii, OBJPROP_WIDTH, 2);
ObjectCreate("CTrnd"+ii, OBJ_TREND, 0, dtStart, iClose(NULL, CandlesTF,ix), dtStart+dif, iClose(NULL,CandlesTF,ix));
ObjectSet("CTrnd"+ii, OBJPROP_WIDTH, 2);
ObjectSet("CTrnd"+ii, OBJPROP_RAY, False);
dtStart -= dif * 2;
ix++;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments