Closing all open trades automatically results in losing price value even when the difference is positive profits - page 5
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
...
Sooner or later you will have problems with this code, as noted clearly by Keith.
In contrary to Keith I really hope you will learn the hard way and lose money with it.
You should be ashamed by your attitude on this topic. You can count on me to remind it to anyone who will try to help you in the future.
What's wrong with "I had one of my programmers check the 'prized' OrderClosePrice() the mod dude has been peddling and guess what - it doesn't need that stdlib at all upon testing :-)."
You do realise that you are the one ranting and wailing do you?
I believe that I have remained calm and collected throughout this thread.
I asked you
Why on Earth would you think that OrderClosePrice() requires that you use stdlib? You don't have to use it, you can just print the error code.
A simple question but you totally ignore it so that you can continue your ranting and wailing.
Nothing in my posts suggest that you have to use stdlib.
Answer the question
Why on Earth would you think that OrderClosePrice() requires that you use stdlib? You don't have to use it, you can just print the error code.
Sooner or later you will have problems with this code, as noted clearly by Keith.
In contrary to Keith I really hope you will learn the hard way and lose money with it.
You should be ashamed by your attitude on this topic. You can count on me to remind it to anyone who will try to help you in the future.
Alain, I did learn that a long time ago. All traders do. If you can see the whole code(of course i didn't post it all here :-D), you'll see the error checking in places to protect equity and all those stuffs, because I saw that thing happened already. If you backread, you'll know who started the nice conversation here ;-). The guy's just too absorbed to get a topper ;-) :)
My clients got manual control which I set in place. That's what they want. They have their team monitor their trades 24/5. They are no ordinary traders. They're already seasoned FX pros. They know their stuff. Whatever they do there, I'm out of it. I'm just a hired gun to work on the code. They know the ramifications, I told them that. It's their money, not mine, and all *disclaimers* of my work are in place. Just like all programmers here. I got paid, they already have the source code if they need to tweak it. The works. The ball's on their turf now.
In any case I said, this thread is done, I got the help I want. Thread closed. TYA.
How simple can that be?
This will be my final post. We are all getting in circles now. I'm out of the carousel.
You do realise that you are the one ranting and wailing do you?
I believe that I have remained calm and collected throughout this thread.
I asked you
A simple question but you totally ignore it so that you can continue your ranting and wailing.
Nothing in my posts suggest that you have to use stdlib.
Answer the question
and without any more of your ranting and wailing please.Ahhh, you're doing the "Broken Record" Syndrome again I see.
Here I got a code fix for that, lemme run that for you:
There. Fixed it. You can play yourself all you want unattended, we'll pretend you're not ranting.
We'll just crank up the volume again if we need to listen to your wise counsel.
Done with this thread, you're on your own now.
CHEERS!
Didn't see that last code coming, hahaHaha!
Got to copy that form.
Maybe somebody can help me out and tell me what I have done to deserve this torrent of childish abuse and sarcasm?
I have modified the code that I posted earlier using his new updated CloseAllTrades() function and ran it through the tester with the spread set at 20 points.
Result
2 09:35:19.299 2020.03.03 00:00:00 ##TEST 1 test started
2 09:35:19.395 2020.03.03 00:05:00 ##TEST 1 EURUSD,H1: open #1 buy 0.02 EURUSD at 1.11294 ok
2 09:35:19.395 2020.03.03 00:05:00 ##TEST 1 EURUSD,H1: open #2 buy 0.02 EURUSD at 1.11294 ok
2 09:35:19.395 2020.03.03 00:05:00 ##TEST 1 EURUSD,H1: open #3 buy 0.02 EURUSD at 1.11294 ok
2 09:35:19.395 2020.03.03 00:05:00 ##TEST 1 EURUSD,H1: open #4 sell 0.01 EURUSD at 1.11274 ok
2 09:35:19.395 2020.03.03 00:05:00 ##TEST 1 EURUSD,H1: open #5 sell 0.01 EURUSD at 1.11274 ok
2 09:35:19.395 2020.03.03 00:05:00 ##TEST 1 EURUSD,H1: open #6 sell 0.01 EURUSD at 1.11274 ok
0 09:35:27.408 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: >>>>>>>>>>>>>>>>>>>>>>>>Inside CloseAllTrades function<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3 09:35:27.408 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
0 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: >>>>>>>>>>>>>>>>>>>>>>>>Inside CloseAllTrades function<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:17 ##TEST 1 EURUSD,H1: OrderClose error 138
0 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: >>>>>>>>>>>>>>>>>>>>>>>>Inside CloseAllTrades function<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
0 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: >>>>>>>>>>>>>>>>>>>>>>>>Inside CloseAllTrades function<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
0 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: >>>>>>>>>>>>>>>>>>>>>>>>Inside CloseAllTrades function<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
3 09:35:27.409 2020.03.03 17:00:18 ##TEST 1 EURUSD,H1: OrderClose error 138
Oh dear! Not 1 trade closed.
At least with the previous version some of the trades closed.
Now substitute the CloseAllTrades() function
Result.
2 09:44:21.312 2020.03.03 00:00:00 ##TEST 2 test started
2 09:44:21.333 2020.03.03 00:05:00 ##TEST 2 EURUSD,H1: open #1 buy 0.02 EURUSD at 1.11294 ok
2 09:44:21.333 2020.03.03 00:05:00 ##TEST 2 EURUSD,H1: open #2 buy 0.02 EURUSD at 1.11294 ok
2 09:44:21.333 2020.03.03 00:05:00 ##TEST 2 EURUSD,H1: open #3 buy 0.02 EURUSD at 1.11294 ok
2 09:44:21.333 2020.03.03 00:05:00 ##TEST 2 EURUSD,H1: open #4 sell 0.01 EURUSD at 1.11274 ok
2 09:44:21.333 2020.03.03 00:05:00 ##TEST 2 EURUSD,H1: open #5 sell 0.01 EURUSD at 1.11274 ok
2 09:44:21.333 2020.03.03 00:05:00 ##TEST 2 EURUSD,H1: open #6 sell 0.01 EURUSD at 1.11274 ok
2 09:44:29.286 2020.03.03 17:00:17 ##TEST 2 EURUSD,H1: close #6 sell 0.01 EURUSD at 1.11274 at price 1.11696
2 09:44:29.286 2020.03.03 17:00:17 ##TEST 2 EURUSD,H1: close #5 sell 0.01 EURUSD at 1.11274 at price 1.11696
2 09:44:29.286 2020.03.03 17:00:17 ##TEST 2 EURUSD,H1: close #4 sell 0.01 EURUSD at 1.11274 at price 1.11696
2 09:44:29.287 2020.03.03 17:00:17 ##TEST 2 EURUSD,H1: close #3 buy 0.02 EURUSD at 1.11294 at price 1.11676
2 09:44:29.287 2020.03.03 17:00:17 ##TEST 2 EURUSD,H1: close #2 buy 0.02 EURUSD at 1.11294 at price 1.11676
2 09:44:29.287 2020.03.03 17:00:17 ##TEST 2 EURUSD,H1: close #1 buy 0.02 EURUSD at 1.11294 at price 1.11676
All closed with no errors.
I've edited his code and replaced the if statements with "OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),15,clrNONE);"
It's still getting the 138 error (requote?) nonetheless; So it's not there on that part. Possibly somewhere else in his code that is causing it.
But regardless I think it's clear he said his clients got manual control when errors arises and they are alerted to override it and they're happy with it. Well those are his clients and his code and he got paid for it, I guess let's leave him at that.
I've edited his code and replaced the if statements with "OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),15,clrNONE);"
It's still getting the 138 error (requote?) nonetheless; So it's not there on that part. Possibly somewhere else in his code that is causing it.
But regardless I think it's clear he said his clients got manual control when errors arises and they are alerted to override it and they're happy with it. Well those are his clients and his code and he got paid for it, I guess let's leave him at that.