Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

True Trading Cost - Net Risk Reward Calculator for MT5 - indicator for MetaTrader 5

fxliner
fxliner
Forex Trader | MetaTrader Tools & Broker Research
Forex trader based in Indonesia, with a focus on price action, market structure and disciplined risk management. I take a structured approach to chart analysis, position sizing and reviewing trading decisions.
Views:
33
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

True Trading Cost - Net Risk Reward Calculator for MT5

This free, source-included chart indicator helps discretionary traders estimate the monetary outcome of a planned Forex or CFD trade before placing an order. It displays the spread, position size, round-trip costs, break-even price, and gross versus net risk/reward. The BUY, SELL and RESET buttons manage a hypothetical plan only; no trade is ever sent.

Planning directly on the chart

  1. Attach the indicator to an MT5 chart. Choose BUY or SELL to initialize the Entry, Stop and Target lines.
  2. Drag the blue Entry, red Stop and green Target lines. The dashboard recalculates the trade plan. RESET initializes the levels from the latest Bid/Ask and ATR(14) of the last closed bar.
  3. Enter the broker's verified round-trip commission per one lot in account currency. For example, 3.50 charged at entry and another 3.50 at exit means an input of 7.00, not 3.50.
  4. Review the net risk, net reward, net R:R, break-even exit, suggested lot size and cost/target percentage before making your own trading decision.

What the calculations include

BUY entry is modeled at Ask and exits at Bid; SELL entry at Bid and exits at Ask. Therefore the entry spread is already represented in the executable-price difference and is not charged again in the net profit/loss. The displayed spread-equivalent amount is informational.

Gross risk and reward are calculated from the entry-to-stop and entry-to-target price distances, contract tick size, and the broker-reported profit/loss tick values. Net loss adds modeled commission, additional fees and slippage, plus negative swap when expressly enabled. Net reward subtracts those fees and includes estimated swap only if the broker calendar has been verified.

Risk-based lot suggestions use a percentage of account equity, always rounded down to permitted volume increments. An insufficient budget produces no lot suggestion rather than silently increasing the risk to a minimum lot. A fixed-lot mode is also available.

Overnight swap and spread insights

The second panel offers an optional swap forecast and four six-hour blocks of observed spread, grouped by broker-server time. Samples are collected only from distinct incoming tick timestamps after the indicator starts; stale quotes are excluded. Statistics exist only in memory and reset daily or when the indicator is removed.

Swap supports OFF, AUTO or MANUAL. Automatic estimates cover supported broker models (disabled, points, deposit currency, and certain same-currency cases). Unsupported modes are clearly indicated and must be entered manually. Actual rollover charges depend on the broker, triple-swap day, cutoff time, holidays and future changes; they cannot be guaranteed by this indicator.

Inputs and configuration

  • Sizing: InpSizing, InpRiskPercent, InpFixedLots.
  • Commission and costs: InpCommissionRoundTurnPerLot, InpCommissionVerified, InpExtraFeesRoundTurnPerLot, InpSlippageRoundTurnPoints, InpWarnCostTargetPercent.
  • Initial chart plan: InpInitialStopATRMultiplier, InpInitialTargetRR, InpFallbackStopPoints.
  • Panel: InpPanelX, InpPanelY, InpShowBreakEvenLine, InpUpdateSeconds, InpShowInsightsPanel.
  • Swap: InpSwapSource, InpRolloverDays, InpManualSwapPerLotNight, InpTripleSwapWeekday, InpSwapStartWeekdayOverride, InpSwapCalendarVerified, InpIncludeSwapInNetRR.
  • Spread statistics: InpCollectSpreadStats.
  • Offline simulation: InpUseManualSymbolSpecs, InpManualTickSizePrice, InpManualTickValueProfit, InpManualTickValueLoss, InpManualMinLot, InpManualMaxLot, InpManualLotStep, InpManualAccountCurrency.

Important limitations

Commission, future slippage, overnight swap, tick-value conversion and execution prices may differ from an actual trade. The indicator does not verify free margin, broker stop-level constraints or order acceptance. If the broker does not supply valid tick values or equity, a clearly labeled manual contract-specification simulation is available for testing only, not as evidence of real broker costs.

No automated orders, EA, DLL or network requests. This is an educational calculation tool, not a trading signal, profit guarantee or substitute for validating a broker's contract specifications and transaction history.


Equivalence Checker: Regression Testing for MQL5 Indicators Equivalence Checker: Regression Testing for MQL5 Indicators

A regression-test harness for indicator code. It compares an incremental, tick-by-tick calculation (the way OnCalculate runs live) with an independent from-scratch reference on a fixed dataset, flags every deviation, and prints a regression digest you can compare between versions of your code.

Smart Break-Even and Partial Close - R-based trade manager Smart Break-Even and Partial Close - R-based trade manager

Trade manager for manual trades and other EAs: moves the stop to break-even at a chosen R multiple, closes part of the position at a second target, then trails the stop in steps. Survives terminal restarts.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.