Problem with opening hedge position
serafin:
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
Hi!
I try to do EA hedge.
Hedge for one open order.
And i don't know what's wrong with conditions.
<CODE DELETED>
serafin:
Where is your OrderSend() ?
Hi!
I try to do EA hedge.
Hedge for one open order.
And i don't know what's wrong with conditions.
i didn't write ordersend because i know it's good. Problem is in the conditions.
OrderSelect(1,SELECT_BY_POS,MODE_TRADES); // Selects the second open order. Fails if there isn't cena=OrderOpenPrice(); // Fails if orderSelect did ce=cena-60*Point; typ=OrderType(); // Fails if orderSelect did (typ=0?) if (OrdersTotal()==1 && typ==0 && ce>bid) OrderSelect(1,SELECT_BY_POS,MODE_TRADES);
- What are Function return values ? How do I use them ? - MQL4 forum
- 60*Point not adjusting for 4/5 digit brokers.
- No braces on the If. If only handles the orderSelect. If there is only one order you try to select the second one. Select always fails. Remaining code is always executed.
serafin:
i didn't write ordersend because i know it's good. Problem is in the conditions.
If you say so . . .i didn't write ordersend because i know it's good. Problem is in the conditions.
OrderSelect() the index starts at 0, not 1. If you only have one open order it's index will be 0.
Hi!
I try to do EA hedge.
Hedge for one open order.
And i don't know what's wrong with conditions.
could you help me?