Do you have the time to properly document this and give a better description?
There was something another thread was hoping to solve -- avoid margin call.
Does this code of yours help avoid margin call ?

Margin strategies to avoid margin calls
- 2018.11.22
- www.mql5.com
Hello forum Would anyone happen to consider margin calls better than not using stops...

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
Calculation of the number of lots by Anton Trefolev.:
Author: Iurii Tokman