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
PS! And please learn to format/style your code properly or use the "Styler" in MetaEditor.
Sorry for the mistake, here is all of my code. Still it is not changing the value of global variable "VL". Even though the function LOTdoubling is called before making any trades.
You did not correct the mistakes I pointed before. Pay attention next time please, or I will not help any further.
Below is a possible solution, but maybe not, because I do not know what you want to achieve. You have not explained it, so I just made some assumptions.
I only fixed some of the points. The rest is up to you.
You did not correct the mistakes I pointed before. Pay attention next time please, or I will not help any further.
Below is a possible solution, but maybe not, because I do not know what you want to achieve. You have not explained it, so I just made some assumptions.
I only fixed some of the points. The rest is up to you.
Thank you for your help and patience. The main issue was your 3rd point which is now fixed. The trade volumes are now being changed, but not as I desired.
What I want to achieve is to multiply the volume (VL) by "x" and for the while loop to add +1 to "x" for each time the balance increases by 10000 and thus also automatically decreasing the multiplication of "VL" from 3 to 2 if the balance falls from say 30000 to 28000.
The following function is to be called before making each trade but in this "x" seems to get very large values of above 36000, I do not understand how this is happening.
Thank you for your help and patience. The main issue was your 3rd point which is now fixed. The trade volumes are now being changed, but not as I desired.
What I want to achieve is to multiply the volume (VL) by "x" and for the while loop to add +1 to "x" for each time the balance increases by 10000 and thus also automatically decreasing the multiplication of "VL" from 3 to 2 if the balance falls from say 30000 to 28000.
The following function is to be called before making each trade but in this "x" seems to get very large values of above 36000, I do not understand how this is happening.
That is because you are multiplying on every single loop iteration. You probably want the following:
Which can be rewritten as follows:
However, this can be simplified and made more efficient as follows:
You should however, be checking for the contract conditions for volume:
However, this is all wrong and dangerous for your account. Learn to properly calculate risk and volume:
That is because you are multiplying on every single loop iteration. You probably want the following:
Which can be rewritten as follows:
However, this can be simplified and made more efficient as follows:
Everything is working as expected now. I thank you sincerely for the help