Hello!
I'm new to programming MQL4 and I got stuck on the OrderSend() function.
If I put it like this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 ,0,0,NULL,00001,0,Aqua);
it works just fine.
But I want my EA to set an initial StopLoss when it opens an order. So I changed it to this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-InitialSL*Point,0,NULL,00001,0,Aqua);
Now it doesn't open no more orders.
The code is exactly as I found it in the MQL4 Documentation.
I also tryed this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-(InitialSL*Point),0,NULL,00001,0,Aqua);
and this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-0.00200,0,NULL,00001,0,Aqua);
and this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-InitialSL*10*Point,0,NULL,00001,0,Aqua);
Nothing works. If you have any ideas, Please help. It's a five-digits broker by the way.
I'm new to programming MQL4 and I got stuck on the OrderSend() function.
If I put it like this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 ,0,0,NULL,00001,0,Aqua);
it works just fine.
But I want my EA to set an initial StopLoss when it opens an order. So I changed it to this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-InitialSL*Point,0,NULL,00001,0,Aqua);
Now it doesn't open no more orders.
The code is exactly as I found it in the MQL4 Documentation.
I also tryed this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-(InitialSL*Point),0,NULL,00001,0,Aqua);
and this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-0.00200,0,NULL,00001,0,Aqua);
and this:
OrderSend(Symbol(),OP_BUY,LotSizeOfEachTrade,Ask,3 , Ask-InitialSL*10*Point,0,NULL,00001,0,Aqua);
Nothing works. If you have any ideas, Please help. It's a five-digits broker by the way.