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
Hello friends,
This code hasn't been tested.
Maybe change your SL/TP
If you know the ticket number or magic number, why use select by pos?
I do something like this to close positions down.
this may be of some help also.
this way I can debug if OrderSend(); has successfully placed the order.
Thanks for the input. However, my closing out is not a problem, the only problem I have is getting sell positions to open.
I'm usng "res" in place of "ticket" does that matter. It's working for buys just find, just not sells. Why change so much?
Hi, any help is appreciated, I can't figure out why my EA only does buy positions. I need it to do sell positions also, on multiple time frames simultaneously.
Hello again,
The first if statement buy++ is always going to greater than the second if statement sell++.
True, or not?
buys and -sells are only variables to a function.I was responding to your comment about
Then you respond referencing the code
Why??
Regarding
The way of coding is odd, but the coder is only interested in whether there is an open order or not so it will do what he wants.
The first if statement buy++ is always going to greater than the second if statement sell++.
I have no idea what you mean, they are if conditions that do not test whether buys>sells
I was responding to your comment about
Then you respond referencing the code
Why??
Regarding
The way of coding is odd, but the coder is only interested in whether there is an open order or not so it will do what he wants.
The first if statement buy++ is always going to greater than the second if statement sell++.
I have no idea what you mean, they are if conditions that do not test whether buys>sells
I'm sorry I haven't found any errors in your code (there are some nonsense in your code but that have no effect on EA's logic). I tried to backtest your EA and it opened both buy and sell orders. You should look for possible errors outside your code.
Hello again,
if you break; the if statement may default to buys++. So if buy is greater than = 0. Some code is executed.