Example
Download scriptThis tool is designed to provide a comprehensive real-time overview of market movements across different assets and timeframes simultaneously. Instead of forcing you to switch between various charts to see what is happening in the market, it aggregates that data into a single, easy-to-read summary displayed directly on your screen.
How it Works
The script focuses on tracking two specific currency pairs (for example, EURUSD and GBPUSD) at the same time. It automatically monitors three distinct time horizons for each pair:
- H1 (1 Hour)
- H4 (4 Hours)
- D1 (Daily)
Key Functionalities
1. Multi-Asset Monitoring The tool captures price data for two different markets simultaneously. This allows you to observe the behavior of multiple currency pairs at a single glance, making it easier to spot correlations or divergence between assets.
2. Multi-Timeframe Analysis Rather than showing you just the "current" price, the logic calculates the price movement across three different timeframes. It looks at the difference between the most recent completed price candle and the one immediately preceding it.
3. Performance Calculation The script performs a mathematical calculation to determine the "distance" moved by the price. It takes the current closing price, subtracts the previous closing price, and then converts that number into standard "points." This gives you a clear picture of how many points the market has shifted in the last hour, 4 hours, or day.
What You See on Your Screen
The result is a clean, text-based summary displayed in the corner of your trading window. It provides a structured list for each currency pair, showing exactly how many points the price has moved across all three timeframes. This eliminates the need to manually calculate changes or flip through multiple tabs, providing you with a steady stream of market momentum data in one organized view.
//+------------------------------------------------------------------+
//| Example.mq4 |
//| Copyright © 2005, Sergey Lykov |
//| http://mtexperts.narod.ru/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Serega Lykov"
#property link "http://mtexperts.narod.ru/"
#property indicator_chart_window
extern string Symbol_1 = "EURUSD";
extern string Symbol_2 = "GBPUSD";
static double point_1;
static double point_2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName("Example");
point_1 = MarketInfo(Symbol_1,MODE_POINT);
point_2 = MarketInfo(Symbol_2,MODE_POINT);
return(0);
}
//+------------------------------------------------------------------+
//| Example of Multipair / Multitimeframe indicator |
//+------------------------------------------------------------------+
int start()
{
// get close at current bars
double close_0_EU_h1 = iClose(Symbol_1,PERIOD_H1,0);
double close_0_EU_h4 = iClose(Symbol_1,PERIOD_H4,0);
double close_0_EU_d1 = iClose(Symbol_1,PERIOD_D1,0);
double close_0_GU_h1 = iClose(Symbol_2,PERIOD_H1,0);
double close_0_GU_h4 = iClose(Symbol_2,PERIOD_H4,0);
double close_0_GU_d1 = iClose(Symbol_2,PERIOD_D1,0);
// get close at previous bars
double close_1_EU_h1 = iClose(Symbol_1,PERIOD_H1,1);
double close_1_EU_h4 = iClose(Symbol_1,PERIOD_H4,1);
double close_1_EU_d1 = iClose(Symbol_1,PERIOD_D1,1);
double close_1_GU_h1 = iClose(Symbol_2,PERIOD_H1,1);
double close_1_GU_h4 = iClose(Symbol_2,PERIOD_H4,1);
double close_1_GU_d1 = iClose(Symbol_2,PERIOD_D1,1);
Comment("\n" +
"The move of price :\n" +
"\n" +
Symbol_1 + ":\n" +
"--------------------------------" + "\n" +
"H1 = " + DoubleToStr((close_0_EU_h1 - close_1_EU_h1) / point_1,0) + "\n" +
"H4 = " + DoubleToStr((close_0_EU_h4 - close_1_EU_h4) / point_1,0) + "\n" +
"D1 = " + DoubleToStr((close_0_EU_d1 - close_1_EU_d1) / point_1,0) + "\n" +
"\n" +
Symbol_2 + ":\n" +
"--------------------------------" + "\n" +
"H1 = " + DoubleToStr((close_0_GU_h1 - close_1_GU_h1) / point_2,0) + "\n" +
"H4 = " + DoubleToStr((close_0_GU_h4 - close_1_GU_h4) / point_2,0) + "\n" +
"D1 = " + DoubleToStr((close_0_GU_d1 - close_1_GU_d1) / point_2,0) + "\n"
);
return(0);
}
//+------------------------------------------------------------------+
Comments