How to create a buy order conditionned by 2 currencies

 

I want to do something very simple for example:

buy 0.1 lot EUR/USD if (EUR/USD > 1.40 AND EUR/GBP > 0.89)

All articles are too much complicated I can't find a sample code which is as simple as what I just want.

 
lep:

I want to do something very simple for example:

buy 0.1 lot EUR/USD if (EUR/USD > 1.40 AND EUR/GBP > 0.89)

All articles are too much complicated I can't find a sample code which is as simple as what I just want.


if (iClose("EURUSD",0,0)>1.4 && iClose("EURGBP",0,0)>0.89)

{

Buy Something

}

double iClose( string symbol, int timeframe, int shift)
Returns Close value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.
For the current chart, the information about close prices is in the predefined array named Close[].