Thanks you for your help.
can't get it to work. Please help
I add this EA to USDCHF and I want it to take a Sell if Bid price hit 30 bar high. (Reverse for buy)
If I make a back test it take buy/sell position every time it hit high/low on USDCHF, it was not the idea. It should only take a sell if EURUSD also hit high the same time as USDCHF.
I know the code is right(I use it for another EA). The thing that is new for me is how to calculate high/low on a different currency pair.
double dLow=Low[Lowest(NULL,0,MODE_LOW,30 ,1)];
double dHigh=High[Highest(NULL,0,MODE_HIGH,30,1)];
double dLow2=Low[Lowest("EURUSD",0,MODE_LOW,30 ,1)];
double dHigh2=High[Highest("EURUSD",0,MODE_HIGH,30 ,1)];
if (Bid<=dLow && Bid<=dLow2 ){
if (StopLoss!=0) ldStop=Ask-StopLoss*Point;
if (TakeProfit!=0) ldTake=Ask+TakeProfit*Point;
SetOrder(OP_BUY,Ask,ldStop,ldTake);
}
if (Bid>=dHigh && Bid>=dHigh2){
if (StopLoss!=0) ldStop=Bid+StopLoss*Point;
if (TakeProfit!=0) ldTake=Bid-TakeProfit*Point;
SetOrder(OP_SELL,Bid,ldStop,ldTake);
}