
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
Hi GumRai, thanks for your time. I've already tried with your changes, but orders keep closing at 1. In other words, profitable orders are not waiting to reach 25.
Even using the line of code previously supplied by DeVries and Raptor?
Hopefully you didn't change this line, you were considering it
If you did change it to 25.00, then you will have all profitable trades of $1+ closed
Even using the line of code previously supplied by DeVries and Raptor?
Hopefully you didn't change this line, you were considering it
If you did change it to 25.00, then you will have all profitable trades of $1+ closed
I've tried all the suggestions, but still not closing right.
I've tried all the suggestions, but still not closing right.
Maybe you can show the complete code that you are using at the moment
Maybe you can show the complete code that you are using at the moment
Please refer back to my post
https://forum.mql4.com/56959/page2#822980
You are not adding up profitable trades only. You are calculating net profit or loss
Please refer back to my post
https://forum.mql4.com/56959/page2#822980
You are not adding up profitable trades only. You are calculating net profit or loss
GumRai, I've made the code changes suggested by Raptor and by you:
https://www.mql5.com/en/forum/146091
https://www.mql5.com/en/forum/146091/page2#822980
And now it seems to closing right. Thanks for that!
Just one more thing. If I wish to calculate only the profitable buys, or only the profitable sells trades, instead of calculating all the profitable trades, what should I change?.
I'm thinking to this change to calculate only buys, but I'm not sure. Is this correct?:
from this:
to this:
I guess that you could add 2 extern bool to the input parameters, called something like "BuyTradesOnly" and "SellTradesOnly" both set to false initially
then
I guess that you could add 2 extern bool to the input parameters, called something like "BuyTradesOnly" and "SellTradesOnly" both set to false initially
then
I didn't add the 2 extern bool, I just change this to close "only buy orders"
and change this to close "only sell orders"
So now I have two EA's. One for close buys, and one for close sells. That's ok for me.
I've tested on both accounts, demo and real. On demo works fine, but in real account, once the profit target is reached, it will start to close positions, but then it will stop closing positions when the remaining orders drops below the profit target. This happens if the price is changing at the moment of close. So it tends to leave open profitable orders, instead of close them all (profitable orders).
I read this post from RaptorUK https://www.mql5.com/en/forum/139654 . It's something like that, but I don't really know what could be the best solution for this issue.
I read this post from RaptorUK https://www.mql5.com/en/forum/139654 . It's something like that, but I don't really know what could be the best solution for this issue.
The solution is given in the thread . . . that is why I created it. Count down in the loop not up.
Ok Raptor, I'll try to make that loop, but before do that, what if I just change
From this:
To this:
Could this do the job?