
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
Read through the execution error codes and make your code comply with the information given there, for example . . .
Hi RaptorUK,
Thank you for the clue.
Another issue (more one.....);
Say that on ECN Broker one trade is open and per " Requirements and Limitations in Making Trades " a Market order can not be closed if Stoploss in inside of Freezing distance, in that case will this CloseAll function close even those orders that are inside the Freezing Distance ?
Best Regards
Luis
Hi RaptorUK,
Thank you for the clue.
Another issue (more one.....);
Say that on ECN Broker one trade is open and per " Requirements and Limitations in Making Trades " a Market order can not be closed if Stoploss in inside of Freezing distance, in that case will this CloseAll function close even those orders that are inside the Freezing Distance ?
Hi RaptorUK,
If possible would like to ask you for some help in this issue;
This piece of code find last OrderLots() and multiples it by the multiplier factor, but some times it passes this factor and I have orders in this way; 0.01, 196,83, 590,49, etc.
Must to say that I've a a limit to open orders, in this case 5. Now, the way I am seen this logic even if comes a condition to open an order above 5 it will not open and then the number of orders in the pool are limited to 5 so, if the code only see 5 orders in the pool the lot size for those orders should be ; 0.01, 0.02, 0.04, 0.08, 0.16. Is anything wrong in this code that I'm not aware about ?
(hope indenting is fine...)
Best regards
Luis
Hi RaptorUK,
If possible would like to ask you for some help in this issue;
This piece of code find last OrderLots() and multiples it by the multiplier factor, but some times it passes this factor and I have orders in this way; 0.01, 196,83, 590,49, etc.
Must to say that I've a a limit to open orders, in this case 5. Now, the way I am seen this logic even if comes a condition to open an order above 5 it will not open and then the number of orders in the pool are limited to 5 so, if the code only see 5 orders in the pool the lot size for those orders should be ; 0.01, 0.02, 0.04, 0.08, 0.16. Is anything wrong in this code that I'm not aware about ?
(hope indenting is fine...)
I do it like this . . .
if the OrderSelect() fails MLots = LotSize ?? why ? your indenting doesn't help you to see what is happening with your if statements and braces . . . did you mean to do this ?
I did this . . .
. . as a quick and dirty method to avoid double comparison issues, have you read this ? Can price != price ?
I do it like this . . .
if the OrderSelect() fails MLots = LotSize ?? why ? your indenting doesn't help you to see what is happening with your if statements and braces . . . did you mean to do this ?
I did this . . .
. . as a quick and dirty method to avoid double comparison issues, have you read this ? Can price != price ?
Hi RaptorUk,
Thank you for your prompt response.
So, I guess that's better to just do not make use of else because that is there for nothing. And thank you for the link provided.
Best egards
Luis
Hi RaptorUK,
I've one issue (more one.....)
Some orders close before time, what I mean is;
These orders have been open and there's a limit to open up to 6. All orders should close by mean of TrailingStop, but orders 1. 3 and 5 have been closed before the others that have been close after (07:43).
Because of these 3 orders have close before than the others give space to open orders 7, 8 and 9 and these ones open with a lot based in last lot (2.43).
So, as far I understood those of erratic close of orders at 07:23 shouldn't been happened and no errors have been found...
The code to close those all by mean of TrailingStop is this one;
Could this code fail and close orders at different times ?
Best regard's
Luis
The code to close those all by mean of TrailingStop is this one;
Could this code fail and close orders at different times ?
OK, this makes no sense . . . a trailing SL is set so that if price goes with an Order the SL is moved towards price so if the new SL is hit there will be less loss or even a profit. Why have a trailing SL if you are going to OrderClose() the trade anyway ? to me that is not a trailing SL, it is not a SL of any kind as you are actively closing the trade via the EA not the SL.
Maybe your CloseAllOnSL() function does something different from what I think it does but, yet gain, you have no comments explaining what your code is trying to do. There is no trailing Sl as there is no OrderModify().
Read this: What are Function return values ? How do I use them ?
add more information to the Print statement, add OrderTicket(), OrderLots(), OrderClosePrice(), Bid, Ask, etc, etc any information you need to determine what the problem was when the error occurred, yo can't easily go back in time and find all this out, so when it happens print it to the log.
So, as far I understood those of erratic close of orders at 07:23 shouldn't been happened and no errors have been found...
Read this: What are Function return values ? How do I use them ?
add more information to the Print statement, add OrderTicket(), OrderLots(), OrderClosePrice(), Bid, Ask, etc, etc any information you need to determine what the problem was when the error occurred, yo can't easily go back in time and find all this out, so when it happens print it to the log.
Hi RaptorUk,
Thanks you for your time.
The code for TrailingStop is in another part, the code sent is only to close all once order have been close by mean of TrailingStop.
Nevertheless I go after your advise and look for any error that could give more additional information why orders close before others.
By the way, in following code makes sense to change position of MLots = 0; from the the actual place to before the for loop ?
Best regards
Luis