Could anyone help me here: I have an EA that places trades. I need a loop to go back and find if one of the orders is gone(either closed for a profit or stopped out). The idea is to make sure if my EA places four trades and one is closed, I want that another order to be placed at that price again. Any help would be greatly appreciated! Thank you guys....... Dan
- Experts: Stop & Limit Bots
- Code for "Do not place another order in same hour when you got a loss order already"
- disabling trade
You need a proposition, code or whole EA?
Roger:
You need a proposition, code or whole EA?
You need a proposition, code or whole EA?
a piece of code.....
int numberorders;
...
init(){
...
numberorders=OrderTotal();
....
}
int start(){
...
if(numberorders < OrderTotal())
{
//your code if new order
..
numberorders=OrderTotal();
}
if(numberorders > OrderTotal())
{
OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS, MODE_HISTORY) ;
//your code for closed order
numberorders=OrderTotal();
}
...
return(0);
}
Roger:
int numberorders;
...
init(){
...
numberorders=OrderTotal();
....
}
int start(){
...
if(numberorders < OrderTotal())
{
//your code if new order
..
numberorders=OrderTotal();
}
if(numberorders > OrderTotal())
{
OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS, MODE_HISTORY) ;
//your code for closed order
numberorders=OrderTotal();
}
...
return(0);
}
That's great...not sure it will do what I want. If I place three orders and the first one closes, how can I determine(by price I think is the best way) that order is not there, then replace it? I appreciate your help......... Dan
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