Forex Risk Calculator Metatrader Indicator | FREE Forex Trading Indicator

Risk Calculator (MetaTrader indicator) — calculates the risk in the form of a maximum loss that can be induced by the currently open positions and active pending orders. In the separate chart window, the results are displayed as the money and percentage risk per currency pair, as well as the overall total risk. You can control the Risk Calculator’s operation by enabling or disabling swaps, spreads, and commission calculation. The visual display parameters can also be tweaked. Furthermore, the maximum potential reward can be calculated. Furthermore, you can calculate risk/reward separately for open positions and pending orders. The indicator is compatible with both MT4 and MT5.

Unlike the Position Size Calculator’s simple risk calculation procedure, this indicator will calculate proper risk values even in complex situations involving hedged trades, pending orders with intersecting stop-loss and take-profit levels, and even MT5’s special stop-limit orders. To speed up the process, the algorithm employs a brute force maximum potential loss search combined with some heuristic techniques. As a result, traders will receive quick calculation results on a small number of orders (up to about 20), but the execution speed will become unsatisfactory as the number of trades increases. Nonetheless, when dealing with a complex portfolio of orders, the Risk Calculator indicator is a useful tool for assessing the exposure to the worst-case scenario.

Input parameters:


  • CalculateSpreads (default = true) — if true, then potential loss due to spreads will become a part of the potential maximum loss.
  • CalculateSwaps (default = false) — if true, then accrued swaps will become a part of the potential maximum loss.
  • CommissionPerLot (default = 0) — your broker’s commission per lot charged in account currency. Enter the value charged for one side of the trade, not round-turn.
  • UseEquityInsteadOfBalance (default = false) — if true, then account equity is used instead of balance in calculations.
  • SeparatePendingOpenCalculation (default = false) — if true, then risk and reward will be calculated separately for open trades and for pending orders.


  • cpFontColor (default = clrAzure) — font color for the currency pair names.
  • mnFontColor (default = clrPaleGoldenrod) — font color for the risk in money form.
  • pcFontColor (default = clrLimeGreen) — font color for the risk in percentage form.
  • hdFontColor (default = clrBlue) — font color for headers.
  • FontFace (default = “Courier”) — font face of the displayed text.
  • FontSize (default = 8) — font size of the displayed text.


  • scaleY (default = 15) — number of pixels per line of output.
  • offsetX (default = 20) — horizontal offset for output.
  • offsetY (default = 20) — vertical offset for output.


  • CalculateReward (default = false) — if true, maximum potential reward will be calculated and displayed.


Example of multiple pending orders and one position (limited loss risk)

Risk Calculator example chart showing multiple pending orders and one position; result: low total risk.

Example of unprotected buy position (nearly unlimited loss risk)

Risk Calculator example chart showing unprotected long position; result: risk of loss is nearly unlimited as price can go down to zero.

Example of unprotected sell position (unlimited loss risk)

Risk Calculator example chart showing unprotected short position; result: risk of loss is not limited with anything at all.

Example of reward calculation

Risk Calculator example chart showing potential reward calculated for multiple trades.

Example of separate calculation for positions and pending orders

Risk Calculator example chart showing separate calculations for risk based on open positions only and on pending orders only.

Known problems

Despite being coded and tested to work in a variety of scenarios, the Forex Risk Calculator has some limitations, restrictions, and the possibility of errors. The following are the known issues with this indicator:

  • When the account currency differs from the quote currency of the pair, for which the orders are placed and the risk is calculated, the results may be inaccurate due to unpredictable fluctuations of the conversion rate. For example, if your account is in JPY and you are trading EUR/USD, then the actual risk will also depend on the future USD/JPY rate. The Risk Calculator will not attempt to predict it.
  • If trader creates too many pending orders with stop-loss and take-profit levels, the indicator may become too slow in its calculation or even stop functioning at all.
  • If your broker offers variable spreads, the calculations will be somewhat inaccurate as the indicator assumes constant spreads on each tick.
  • The indicator does not take into account the price slippage of pending orders’ execution.
  • The indicator ignores the lack of margin for order execution. It means that if you set up a pending order that will require more free margin than your account can provide, the Risk Calculator will still consider the possibility of that order’s execution.
  • The indicator does not take into account the correlation between different currency pairs. Risk value is calculated for each trading instrument separately. For example, if you buy EUR/USD and sell GBP/USD as a hedge, the indicator will calculate the risk of each position separately.
  • The indicator does not take into account the triangular arbitrage and other forms of arbitrage with several currency pairs. For example, if you go long EUR/USD, long USD/JPY and short EUR/JPY, the Risk Calculator will treat those positions as three separate trades with their own risks.

Downloads (ver. 1.12, 2020-11-19)

Risk Calculator is also developed via a dedicated GitHub repository. You can take part in its development by submitting your own code modifications via pull-requests and by reviewing existing suggestions, changes, fixes, and so on.

Risk Calculator for MetaTrader 4

Risk Calculator for MetaTrader 5

You May Also Like ❤ :

Leave a Reply

Your email address will not be published.