This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.
You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.
MT5 (MQL5) Version of Position Size Calculator - Based on VP Money Management rules
This version has been tested and works in both versions; in MT4 (MQL4) as well as in MT5 (MQL5).
See the original MT4(MQL4) only version here: https://www.mql5.com/en/code/23886
NOTE: I'm aware there appears to be an issue with the volume calculation and cross currency exchange rates. I'm working on fixing these issues.