Garner Risk Calculator
- Utilità
- Versione: 1.7
Garner Risk Calculator for MetaTrader 5
## Visual trade planning, position sizing and manual order placement
Garner Risk Calculator is an MT5 Expert Advisor that brings trade planning and position sizing directly onto your chart. Position your Stop Loss and Take Profit, choose the amount you want to risk, and view the calculated lot size before placing an order.
The dark navy panel with blue accents provides a clear view of your proposed trade. It is a manually operated calculator and order-entry tool: you choose the direction, levels and timing of every trade.
This description covers version 1.07.
## Movable chart panel
- Drag the blue title bar to reposition the panel within the chart.
- Collapse and expand the panel using the minus/plus button.
- The panel saves its position and reapplies its display properties when the EA restarts, including after timeframe changes.
- BUY and SELL use green and red button colours for quick identification.
- Enter values directly into editable fields and press Enter to apply them. Decimal points and decimal commas are accepted.
Panel-position persistence does not mean the complete trade plan is saved. On reinitialization, risk inputs and planning lines are initialized again; review the setup after changing timeframes or EA settings.
## Draggable Entry, Stop Loss and Take Profit
Three colour-coded horizontal lines show the proposed trade:
| Line | Colour | Behaviour |
| --- | --- | --- |
| Entry | Blue | Follows the live entry quote in Market mode; draggable and editable in Pending mode. |
| Stop Loss | Red | Drag the line or enter a price or distance in the panel. |
| Take Profit | Green | Drag the line or enter a price or distance in the panel. |
The panel updates prices, distances and calculations as the levels change. Line descriptions include prices and relevant distance information. Switching direction preserves manually positioned levels when they already form a valid setup for the new direction; otherwise, the planning lines reset.
## Three position-sizing modes
**Percentage risk:** Choose account balance or equity, then enter your desired risk percentage. For example, entering 0.30 means 0.30%. On a 10,000 account balance, that produces a 30-unit risk budget in the account currency.
**Cash risk:** Enter a fixed amount in your account currency. The calculator sizes the proposed trade using its Entry-to-SL distance.
**Fixed lots:** Enter the desired trading volume and view the resulting estimated loss and potential profit. This mode does not size volume to a percentage or cash-risk budget.
Volume is rounded down to the broker's lot step and capped by the broker's maximum and your MaximumLots input. If the calculated volume is below the broker's minimum lot, the calculator reports that the risk budget is too small rather than increasing the volume to the minimum.
## Information displayed
- BUY or SELL direction.
- Market, Pending Limit or Pending Stop mode.
- Entry, Stop Loss and Take Profit prices.
- SL and TP distances in pips or points.
- Selected risk mode, risk value and balance/equity basis.
- Calculated lot size.
- Estimated loss in account currency and as a percentage of the selected account basis.
- Estimated profit at Take Profit in account currency.
- Reward-to-risk ratio.
- Estimated required margin.
- Current spread and the selected account-basis amount.
- Validation messages and order-request status.
## Market and pending orders
**Market mode** uses the current Ask for a BUY and Bid for a SELL. The blue Entry line is read-only and follows that quote. It is not a crossing-price trigger.
**Pending mode** allows you to position the Entry line manually. The calculator selects Buy Limit, Buy Stop, Sell Limit or Sell Stop according to the chosen direction and Entry's relationship to the current quote. Stop-limit orders are not included.
Only the order-mode button switches Market/Pending mode.
## Confirmed manual execution
Trading is disabled by default. With EnableTrading enabled and MT5 trading permissions active, click Place Trade, review the displayed plan, then click Confirm within ten seconds.
The calculator rechecks the plan before sending. Changed trade levels, direction or order type, or increased calculated volume/risk beyond the approved allowance, require another review. Rapid duplicate clicks are suppressed, and orders are not automatically retried.
Additional trades are allowed, including when the symbol already has exposure. Each needs a fresh confirmation. The displayed risk relates to the proposed order, not total account exposure. On a netting account, another order may add to, reduce or reverse the existing position.
Reset Lines resets the planning setup; it does not close a position or cancel a broker order.
## Broker-aware calculations and checks
The calculator uses MT5's profit-calculation function to estimate results in the account currency. It uses symbol tick size for planning prices and respects volume limits and steps. It checks SL/TP placement, minimum stop distances, pending-entry distance and estimated free margin, then runs MT5's order check before submission.
An optional round-trip commission estimate per lot is included in estimated loss and deducted from estimated profit. Configure it in your account currency.
The code is designed to use broker symbol specifications across forex and other supported instruments. Forex distance units are inferred from symbol digits; non-forex instruments default to points. PipSizeOverride lets you define the price movement represented by one pip, useful where gold, index or crypto conventions differ. Verify results against your broker's specifications on demo.
## Configurable inputs
| Input | Default | Purpose |
| --- | --- | --- |
| EnableTrading | false | Enables optional order placement. |
| InitialRiskPercent | 0.30 | Initial percentage-risk value. |
| UseEquityInitially | false | Starts with balance; true selects equity. |
| InitialSLDistance | 25.0 | Starting SL distance in the selected distance units; reset may enlarge this to meet stop-distance requirements. |
| InitialRewardRisk | 2.0 | Starting TP distance as a multiple of the initial SL distance. |
| PipSizeOverride | 0.0 | Custom price units per pip; zero uses automatic units. |
| RoundTripCommissionPerLot | 0.0 | Estimated opening-plus-closing commission per lot, in account currency. |
| MaximumLots | 100.0 | User-defined volume cap, subject to broker limits. |
| DeviationPoints | 10 | Requested permitted price deviation in points; execution rules depend on the broker. |
| MagicNumber | 26091901 | Identifier attached to orders sent by the calculator. |
Open the EA's Inputs through its chart properties, normally using F7 in the MT5 terminal.
ENJOY!
