I want to calculate my risk per trade relative to account balance (for example only risk 2% of balance per trade). Of course the stop loss is relative, lets imagine the Stop Loss variable will be changing and will use ATR for calculation.
I have the expert ready but I need help with this code.
So far, I have found 2 ways (but I don’t know how to use it).
- This link have a code that seems correct, bu I’m not sure how to call the function an use it on my robot. . I already saved in the include folder and use the #include. Also called the function GetLotSize(lotsize) but says "incorrect parameters).
- I know there is a .mqh file in include/experts/money/MoneyFixedRisk.mqh, this seems to do the calculation bu I’m not sure how to use it.
If you have other idea on how to calculate this for MQL5 or know how to use this codes, please let me know, it’s killing me at the moment.