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
i told you already the problem
Sorry deVries. You lost me here. The code must close all open Long trades. I am not using magicnumbers and the Tally is only used to determine the lot size when opening trades. Maybe I am missing what you are trying to explain.
Once again, thanks for the help.
You DO NOT HAVE any exception handling in your post. Check your return codes and Print them in the journal.
Hi WHRoeder,
Sorry I was very vague in my previous post. What I meant was that I removed all other code except the OrderSend() instruction and ADDED exception handling. This is how the complete code look like:
I added the Comment "Starting" just to make sure that the program does in fact execute and also that it executes within the "if" statement. I made a print screen of the results and as can be seen the comment is displayed within the chart and as can be seen in the Journal tab, there is absolutely nothing. It is as if the OrderSend does not run at all.
Hi WHRoeder,
Sorry I was very vague in my previous post. What I meant was that I removed all other code except the OrderSend() instruction and ADDED exception handling. This is how the complete code look like:
I added the Comment "Starting" just to make sure that the program does in fact execute and also that it executes within the "if" statement. I made a print screen of the results and as can be seen the comment is displayed within the chart and as can be seen in the Journal tab, there is absolutely nothing. It is as if the OrderSend does not run at all.
Don't use Comment(), it is easy to get fooled by it . . . OK it says Starting on the chart but is that from the current run or from an older version of the code ? do you clear the comment in deinit() ? use Print() then you can see the information sequentially and contemporaneously.
Please change your Comment() to a Print(), re-run the EA and post the expert log file . . .
Don't use Comment(), it is easy to get fooled by it . . . OK it says Starting on the chart but is that from the current run or from an older version of the code ? do you clear the comment in deinit() ? use Print() then you can see the information sequentially and contemporaneously.
Please change your Comment() to a Print(), re-run the EA and post the expert log file . . .
I found the problem. It had to do with the lot size. Thanks all for your help. I got some good tips here that improved my other code, such as the correct way to close all open trades and how to do good exception handling.
Many thanks.