this is not correct, because you are dealing with Positions, so when you execute market orders, it should be:
Please at least first try and build a simplistic EA that follows rules correctly. If you successfully build a simple EA (as advised above) that follows the rules correctly, there will be far less caveats in a bigger project
I really wanna learn how to trade in and out. Start with the smallest positions and simplest systems and don't just gamble away your money. I find that it is great for gaining some experience and as time passes you will develop an eye for situations related to entries and exits
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
When you deal with market orders
this is not correct, because you are dealing with Positions, so when you execute market orders, it should be:
Please at least first try and build a simplistic EA that follows rules correctly. If you successfully build a simple EA (as advised above) that follows the rules correctly, there will be far less caveats in a bigger project
I understand, thank you for all your help!
NormalizeDouble
Thank you!
As your program seems to be an EA use the debugger to check where and why your program fails (a Script does not run in the debugger)
Beside that: There is almost nothing that has not been programmed for MT5. So searching is most probably a lot faster than coding!
Maybe you should start here:
Beginner's club: https://www.mql5.com/en/forum/330288
https://www.metatrader5.com/en/metaeditor/help/development/debug
https://www.mql5.com/en/articles/654
https://www.mql5.com/en/articles/35
https://www.mql5.com/en/articles/2041
https://www.mql5.com/en/articles/272
https://www.mql5.com/en/articles/150