CHF_CORR_EUR
Download scriptThis tool is designed to assist traders by identifying specific price movements in the USD/CHF currency pair to provide actionable signals for the EUR/USD market. It operates on the principle of correlation, meaning it looks for a relationship between how these two major currency pairs behave relative to one another.
How the Logic Works
The script continuously monitors the 1-minute price action of the USD/CHF pair. It specifically focuses on the "price difference"—the gap between where a candle opened and where it closed during that one-minute window.
The logic follows these specific steps:
- Data Tracking: The system tracks the opening and closing prices of the USD/CHF pair in real-time.
- Movement Analysis: It calculates the magnitude of the move for every 1-minute candle.
- Signal Generation: The tool looks for significant price shifts that exceed a specific threshold (equivalent to 6 pips).
Trading Signals
Based on the direction and strength of the USD/CHF movement, the script provides the following recommendations:
- Buy Signal (EUR/USD): If the USD/CHF price drops significantly (specifically, if the difference between the open and the close is a negative value of 0.0006 or greater), the tool identifies this as a signal to Buy EUR/USD.
- Sell Signal (EUR/USD): If the USD/CHF price rises significantly (specifically, if the difference between the open and the close is a positive value of 0.0006 or greater), the tool identifies this as a signal to Sell EUR/USD.
User Notifications
When these specific conditions are met, the script provides immediate feedback in three ways:
- On-Screen Comments: It displays the current price difference and the recommended action directly on your trading chart.
- Alerts: It triggers an audible alert notification to notify you of the move instantly.
- Visual Tracking: It plots a line on a separate window, allowing you to visualize the price history of the monitored currency.
//+------------------------------------------------------------------+
//| 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");
Alert ("USDCHF ",diff," Difference BUY EURUSD");
}
if (diff>=0.0006 && diff>0)
{
Comment("diff ",diff," Sell eur");
Alert ("USDCHF ",diff," Difference SELL EURUSD");
}
if (Curency == "CHF") Idx[i] = UsdChf[i];
}
}
Comments