So I want to open trades depending on multiple criteria with my EA... Doesn't really matter TBH...
The problem is that EAs run in one window. So naturally, I'd like for an EA to open assess conditions and open all the trades within one chart. Everything's fine except...
Broker won't allow an EA that runs in a chart open a trade on a different one.... It is surely that. I eliminated any other case.
Inputs just for this example:
input double LotSize = 0.01;
input int Slippage = 10;
input double StopLoss = 1000.0;
input double TakeProfit = 1000.0;
input const string SymbolA = "EURUSD";
input const string SymbolB = "GBPUSD";
The commands I use (I have them copy-pasted from another EA that works just fine so I am certain they work as well, plus I used extreme TP/SL to surpass any restrictions that brokers might have) :
TicketA = OrderSend(SymbolA,OP_SELL,LotSize,Bid,Slippage,Bid+StopLoss*Point,Bid-TakeProfit*Point,EAComment,OrderTicket(),0,clrDarkRed);
Sleep(1000);
TicketB = OrderSend(SymbolB,OP_BUY,LotSize,Ask,Slippage,Ask-StopLoss*Point,Ask+TakeProfit*Point,EAComment,OrderTicket(),0,clrDarkBlue);
Error (EURUSD one opens normal as the EA runs in the EURUSD chart):
2020.12.18 01:01:45.318 '22644076': order buy market 0.01 GBPUSD sl: 1.21670 tp: 1.23670
2020.12.18 01:01:45.528 '22644076': order buy 0.01 GBPUSD opening at market sl: 1.21670 tp: 1.23670 failed [Invalid S/L or T/P]
Any suggestion how can I fix/bypass this?
Thanks in advance!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…