Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Discover: Metatrader 5 Indicator | Risk Based Position Size Calculator | Trading Tool Update

Discover expert developed MetaTrader tools that can complement professional solutions.


The indicator does not open orders or manage existing positions.

Risk can be defined as:

• Percentage of account balance
• Percentage of account equity
• Fixed amount in the account currency

The calculation uses the symbol’s trade tick size and loss tick value. A configurable round-turn commission estimate can also be included.
The raw calculated volume is rounded down according to the broker’s volume step. This prevents upward rounding from exceeding the selected risk.

The chart panel displays:


• Buy or sell planning direction
• Entry, stop and calculated target prices
• Stop distance in points
• Risk amount in account currency
• Estimated risk for one lot
• Raw calculated volume
• Broker normalized volume
• Configurable reward-to-risk ratio
• Validation status

Inputs
InpRiskMode
Selects percentage of balance, percentage of equity or fixed money risk.
InpRiskValue
Defines the selected percentage or fixed account-currency amount.
InpInitialSLPoints
Defines the initial distance between the Entry and Stop lines.
InpRewardRisk
Defines the reward-to-risk ratio used for the Target line.
InpCommissionLot
Optional estimated round-turn commission per lot.

The remaining inputs control line colors, panel color, chart corner and panel position.

How to use
1. Compile RiskBasedPositionSizeCalculator.mq5 in MetaEditor.
2. Place the indicator in the MQL5\Indicators directory.
3. Attach it to the required chart.
4. Drag the Entry and Stop lines to the planned prices.
5. Read the normalized volume and validation status from the chart panel.

The calculated position size is an estimate based on the current account and broker symbol data. Actual trade risk may differ because of slippage, gaps, commissions, swaps and broker side execution.

Smooth out market noise with the Heiken Ashi Expert Advisor for MT4 and MT5. Reliable trend-following automation. Details here.


Image for Risk Based Position Size Calculator

Build better strategies with RobotFX professional tools – check them out.

76703

Best MetaTrader Indicators + Profitable Expert Advisors