You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Wow thank you, I think this method is more versatile.
By the way, how to declare in EA that the order has been opened, OrderSend as I understand sends only the order ticket. Maybe, this can be implemented using OrderSelect?
Before the initialization block, let's declare a variable which will carry the order ticket. For example:
int Ticket;
In the start () function, before calling OrderSend(), we write:
Ticket=-1;
Since the OrderSend() function returns a ticket of the order, then we check if the Ticket variable is greater than zero, then the order has been placed. Otherwise, we have no order - see OrderSend reference - it is written there that if the order cannot be set, the function will return the value = (-1), not a tick. On the next tick, because the variable is first initialised with value = -1 and no order is set, the variable will remain negative until the end of the code. And this continues until a new order is placed.
Could you please show me an example, because I'm having a hard time.
Why is Ticket=(-1); in brackets?
What kind of nonsense is this, the order is open and the ticket is still -1.
return(Ticket);?
Is it possible to open several orders at the same time? For example like this
Is it possible to open several orders at the same time? For example like this
Is it possible to open several orders at the same time? For example like this?
You cannot do it all at once.
Only consecutively.