Myfxpaddy Trade Risk Calculator Indicator

Myfxpaddy Trade Risk Calculator Indicator

Size

Explore Now »

 Myfxpaddy Trade Risk Calculator for MetaTrader 4 and MetaTrader 5 calculates the risk in terms of potential maximum loss from currently open positions and active pending orders. The results are displayed as money and percentage risk per currency pair, as well as the overall total risk in a separate chart window. You can control the Risk Calculator by enabling or disabling calculations for swaps, spreads, and commissions. Additionally, maximum potential reward can be calculated, and you can choose to calculate risk/reward separately for open positions and pending orders. This indicator is available for both MT4 and MT5.


    



Unlike the simple risk calculation module of the Position Sizer, this indicator calculates 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. The algorithm uses a brute force maximum potential loss search with heuristic techniques for speed. Traders will get fast calculation results with a normal number of orders (up to about 20), but execution speed will slow as the number of trades increases. Nevertheless, the Myfxpaddy Trade Risk Calculator is a useful tool for assessing the worst-case scenario exposure when managing a complex portfolio of orders.


Input Parameters


Main


CalculateSpreads (default = true): If true, potential loss due to spreads is included in the potential maximum loss.

CalculateSwaps (default = false): If true, accrued swaps are included in the potential maximum loss.

CommissionPerLot (default = 0): 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, account equity is used instead of balance in calculations.

SeparatePendingOpenCalculation (default = false): If true, risk and reward are calculated separately for open trades and pending orders.


Fonts


cpFontColor (default = clrAzure): Font color for currency pair names.

mnFontColor (default = clrPaleGoldenrod): Font color for risk in money form.

pcFontColor (default = clrLimeGreen): Font color for risk in percentage form.

hdFontColor (default = clrLightBlue): Font color for headers.

FontFace (default = “Courier”): Font face of the displayed text.

FontSize (default = 8): Font size of the displayed text.


Spacing


scaleY (default = 15): Number of pixels per line of output.

offsetX (default = 20): Horizontal offset for output.

offsetY (default = 20): Vertical offset for output.


Reward


CalculateReward (default = false): If true, maximum potential reward is calculated and displayed.

ShowRiskRewardRatio (default = false): If true, risk-to-reward ratio is calculated and displayed. Works only if CalculateReward is set to true.


Screenshots


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







Example of unprotected buy position (nearly unlimited loss risk):







Example of unprotected sell position (unlimited loss risk):







Example of reward calculation:







Example of separate calculation for positions and pending orders:







Example of risk-to-reward ratio calculations:







Known Problems


Despite being coded and tested to work in multiple scenarios, the Myfxpaddy Trade Risk Calculator has some limitations and potential for errors. Here is a list of 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.

If too many pending orders with stop-loss and take-profit levels are created, the indicator may become too slow or stop functioning.

If your broker offers variable spreads, the calculations may be somewhat inaccurate as the indicator assumes constant spreads on each tick.

The indicator does not account for price slippage of pending orders’ execution.

The indicator ignores the lack of margin for order execution, meaning it will still consider the possibility of execution even if a pending order requires more free margin than available.

The indicator does not account for the correlation between different currency pairs. Risk value is calculated for each trading instrument separately.

The indicator does not account for triangular arbitrage and other forms of arbitrage with several currency pairs.


Original build credits to: earnforex, indicator revamped and improved by myfxxpaddy.

Contact form

Name

Email *

Message *