This script is designed to monitor the relationship between two specific currency pairs—specifically the USD/CHF and EUR/USD. The core logic relies on identifying significant price movements in one pair to generate trading signals for another, based on their historical correlation.
How the Logic Works
1. Real-Time Data Monitoring The tool constantly tracks the "Price Action" of the USD/CHF currency pair on a 1-minute timeframe. It specifically looks at the difference between the current closing price and the opening price of each individual minute bar.
2. The Trigger Mechanism (Volatility Detection) Instead of looking at general trends, the script identifies moments of sudden movement. It calculates whether the price has moved significantly within a single minute. Specifically:
- It looks for movements greater than or equal to 6 pips (represented as 0.0006 in the currency value).
3. Correlation Signals When the script detects these specific movements in the USD/CHF pair, it interprets them as "leads" for the EUR/USD pair:
- Buy Signal: If the price of the USD/CHF drops by 6 pips or more within that minute, the script recognizes a downward move and issues a recommendation to Buy EUR/USD.
- Sell Signal: If the price of the USD/CHF rises by 6 pips or more within that minute, the script recognizes an upward move and issues a recommendation to Sell EUR/USD.
4. User Notifications Whenever one of these conditions is met, the tool provides immediate feedback to the trader in two ways:
- On-Screen Comments: It prints a text message directly on the trading chart showing the exact price difference, the suggested action (Buy or Sell), and the current time.
- System Alerts: It triggers a pop-up alert notification to notify the trader instantly of the opportunity as it happens in real-time.
Summary for the Trader
Essentially, this tool acts as a "scout." It watches the USD/CHF pair for sudden 6-pip jumps or drops every minute. When it sees that move happen, it tells you exactly when to enter a trade on the EUR/USD pair, assuming that the two currencies will react in a corresponding manner.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| Correlation USDCHF/EURUSD .mq4 |
//| Copyright © 2005, Yuri Makarov. |
//| http://mak.tradersmind.com |
//+------------------------------------------------------------------+
//Correlates chf prive ON eur 1 min chart
// if chf bar (1 min) is greater than 3 pips it recommends sell/buy eur
//
#property copyright "Copyright © 2005, Perky_z."
#property link "Perky_z@yahoo.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 OrangeRed
extern string Curency = "CHF";
double UsdChf[],UsdChfO[];
double Idx[];
double diff,diff1;
int init()
{
IndicatorShortName(Curency);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Idx);
return(0);
}
void start()
{
//I've put the period statement in - this means that
// you can get close for other periods onto the current chart
ArrayCopySeries(UsdChf,MODE_CLOSE,"USDCHF",PERIOD_M1);
ArrayCopySeries(UsdChfO,MODE_OPEN,"USDCHF",PERIOD_M1);
int counted_bars=IndicatorCounted();
double USD;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
{
diff=(UsdChf[i]-UsdChfO[i]);
diff1=(UsdChf[i+1]-UsdChfO[i+1]);
// Comment("Before",diff1,"\nnow ",diff);
if (Curency == "CHF") Idx[i] = UsdChf[i];
if (diff<=-0.0006 && diff<0)
{
Comment("diff ",diff," Buy EUR ",Ask," ",TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS));
Alert ("USDCHF ",diff," Difference BUY EURUSD");
}
if (diff>=0.0006 && diff>0)
{
Comment("diff ",diff," Sell EUR ",Bid," ",TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS));
Alert ("USDCHF ",diff," Difference SELL EURUSD");
}
if (Curency == "CHF") Idx[i] = UsdChf[i];
}
}
Comments