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.
I created the following code and it worked for the EUR/USD pair, but it didn't work for the US30 or US500 index.
But when I change the values of the variables as follows:
contractSize = 1 // for US30
marginPercentage = 0.5 // for US30
These are the settings for US30.
Strange results start to appear.!
I really hope for a solution.
Thank you.