QRM Risk Calculator
- Утилиты
-
Dario Cadeddu
Quantitative Trading Systems Developer focused on risk management, market regime analysis and structured trading workflows for MetaTrader 5. - Версия: 1.0
Short description
Position sizing and margin calculator for MetaTrader 5 with separate BUY and SELL calculations.
Full description
QRM Risk CalculatorQRM Risk Calculator is a position sizing and margin calculation utility for MetaTrader 5.
It calculates BUY and SELL volume separately according to the selected percentage risk, stop-loss distance, account data, symbol specifications, and current Bid and Ask prices.
The calculator displays the estimated monetary loss at the stop loss, theoretical reward at the take profit, effective risk/reward ratio, required margin, projected margin level, and the percentage of equity absorbed by the new margin.
QRM Risk Calculator is designed for trade preparation and risk calculation. It does not generate trading signals, send orders, modify positions, or close trades. The calculated volume must be transferred manually into the user's trading workflow.
Main features
- Separate BUY and SELL position sizing
- Risk calculation based on account balance
- Effective monetary risk and risk percentage
- Theoretical monetary reward
- Effective risk/reward ratio
- Read-only TP distance automatically calculated from SL and RR
- AUTO, PIPS, and POINTS distance modes
- Broker-based margin calculation
- Projected margin level
- New-trade margin usage as a percentage of equity
- Available free-margin verification
- Minimum-lot protection
- Maximum-lot limit handling
- FULL and MINI panels
- Optional per-chart persistence of panel mode and Risk/SL/RR values
Distance units
The DistanceUnit parameter determines how SL and TP distances are interpreted.
AUTO
Uses pips for Forex symbols and MetaTrader 5 points for other instruments.
PIPS
Forces SL and TP distances to be interpreted in pips.
POINTS
Forces SL and TP distances to be interpreted in MetaTrader 5 points.
In AUTO mode, Forex symbols use pips, while other instruments use points. The actual monetary result always depends on the symbol specifications supplied by the broker.
How the calculation works
Requested monetary risk:
Requested monetary risk = Balance × Risk / 100
QRM Risk Calculator calculates the theoretical stop-loss value separately for BUY and SELL and determines the compatible trading volume.
The calculated volume is normalized according to the broker's minimum volume, maximum volume, and volume step.
The volume is never rounded upward if doing so would cause the effective monetary risk to exceed the requested risk budget.
The theoretical take-profit distance is calculated as:
TP distance = SL distance × RR
Margin calculations use the current MetaTrader 5 account, symbol, leverage, and broker calculation rules.
Information displayed
For both BUY and SELL calculations, the panel can display:
- Lot — normalized trading volume
- Risk — estimated monetary loss at the stop-loss price
- Reward — theoretical monetary profit at the take-profit price
- RR — effective monetary reward/risk ratio
- Risk % — effective monetary risk as a percentage of balance
- Margin — estimated margin required for the new volume
- ML — projected margin level after adding the new margin
- Use — new margin as a percentage of current equity
- TP — theoretical distance calculated from SL × RR
BUY and SELL results may differ because Bid/Ask prices, account-currency conversion, and broker specifications may produce different values for each direction.
Calculation controls and status messages
QRM Risk Calculator can block or limit a result when the requested setup is not compatible with the current account, symbol, price, or broker constraints.
Possible states include:
- CALCULATION READY
- READY - MAX LOT LIMIT APPLIED
- RISK_BELOW_MIN_LOT
- INSUFFICIENT_FREE_MARGIN
- MARGIN_LEVEL
- MARGIN_USAGE
- INVALID_SL_RANGE
- NO_TICK_DATA
- INVALID_SYMBOL_METADATA
- PROFIT_CALC_UNAVAILABLE
- MARGIN_CALC_FAILED
- ACCOUNT_NOT_READY
For example, RISK_BELOW_MIN_LOT prevents the calculator from forcing the broker's minimum lot when that minimum volume would exceed the requested monetary risk.
If the theoretical volume exceeds the broker's maximum allowed volume, the calculator applies the maximum permitted lot and displays READY - MAX LOT LIMIT APPLIED. The effective monetary risk may therefore be lower than requested.
FULL and MINI panels
The FULL panel displays the extended account and calculation context, including balance, equity, free margin, symbol, timeframe, spread, and margin information.
The MINI panel retains the essential Risk, SL, unit, RR, TP, BUY/SELL results, and calculation status while reducing the space occupied on the chart.
When persistence is enabled, FULL/MINI mode and Risk/SL/RR values can be remembered separately for each chart.
Margin controls
QRM Risk Calculator performs preventive margin checks using the broker and account data available in MetaTrader 5.
The tool can verify:
- estimated margin required for the new volume
- projected margin level after adding the new margin
- percentage of equity absorbed by the new margin
- available free margin
With the default configuration:
- Minimum projected Margin Level: 300%
- Maximum new-trade margin usage: 25%
If the configured limits are exceeded, the relevant BUY or SELL calculation is blocked.
Minimum-lot protection
If the theoretical volume required to respect the selected risk is below the broker's minimum tradable lot, QRM Risk Calculator does not force the minimum lot.
Instead, it displays:
RISK_BELOW_MIN_LOT
This prevents the calculator from suggesting a volume that would exceed the requested monetary risk.
Quick start
- Apply QRM Risk Calculator to the desired chart.
- Verify that the account, symbol, and timeframe shown in the panel are correct.
- Set Risk, SL, and RR.
- Check the effective distance unit displayed in the panel.
- Read the BUY and SELL calculations separately.
- Verify Lot, Risk, Reward, Margin, ML, and Use.
- Transfer the calculated volume manually only after verifying the result.
The operational reference is the effective monetary risk shown in the BUY or SELL row, not only the percentage entered by the user.
What QRM Risk Calculator does not do
QRM Risk Calculator:
- does not generate entry or exit signals
- does not send BUY or SELL orders
- does not modify or close open positions
- does not aggregate portfolio risk or the risk of open positions
- does not calculate total currency exposure
- does not manage prop-firm challenge drawdown or targets
- does not generate CSV audit files or trading reports
The absence of signals and automated execution is part of the product design: the tool calculates and verifies, while every trading decision and every order remain under the user's control.
Requirements
- MetaTrader 5
- Connected demo or live account
- Valid Bid and Ask prices
- Valid symbol specifications supplied by the broker
- Availability of MetaTrader 5 OrderCalcProfit and OrderCalcMargin functions for the selected symbol
The global Algo Trading button is not required because QRM Risk Calculator does not execute trades.
Important operational notes
The monetary risk displayed in the BUY or SELL row is the primary operational reference. It may be lower than the requested percentage because of the broker's volume step or maximum-volume limit.
BUY and SELL values can differ because Bid and Ask prices, account-currency conversion, and broker calculation rules may differ by direction.
The panel updates automatically. Automatic updating does not mean that the product performs automated trading.
For a new broker or symbol, verify the calculation on a demo account before using the calculated volume on a live account.
The same numerical distance can have a different monetary impact on Forex, metals, indices, energy products, cryptocurrencies, and CFDs because symbol specifications vary by broker.
Recommended first use
Before using QRM Risk Calculator on a live account, verify the results on a demo account with the same broker.
As a minimum, test:
- a standard valid calculation
- a RISK_BELOW_MIN_LOT case
- a margin-control case
Always verify the effective monetary risk displayed in the BUY or SELL row before transferring the calculated volume into an order.
Risk warning
QRM Risk Calculator is a risk-calculation and operational-support tool.
It does not constitute financial advice, does not guarantee profits, and does not eliminate trading risk.
Results depend on data supplied by MetaTrader 5 and the broker, including prices, symbol specifications, tick value, contract size, margin rules, minimum and maximum volume, volume step, and the availability of calculation functions.
The user remains responsible for configuration, independent verification of results, every trading decision, and every order entered manually.
