Trade Risk Desk
- Utilità
- Versione: 1.0
Trade Risk Desk answers one question at the moment you need it answered: what volume makes this stop cost exactly what you decided to risk. Drag the stop line to where it belongs on the chart and the panel prints the volume, the money behind it, and the margin the position will hold.
What It Answers
Set the risk as a percent of balance or as a fixed amount in account currency. Put the stop where your idea says it belongs. The panel reads the symbol settings your broker publishes and prints:
- the volume the broker will accept, next to the raw calculated one
- what the stop costs in account currency and in percent of the balance
- the margin the position will hold, and its share of your free margin
- the broker's minimum distance for a stop, in points
- price levels for the first R multiples
Every figure comes from the symbol settings your terminal already holds, so they match the account you are looking at rather than a generic table.
The Two Lines
Two horizontal lines carry the trade. The entry line follows the market price, or stays where you put it when you plan an entry ahead of time. The stop line is yours to drag, and the panel recalculates the moment you drop it.
Dragging the stop across the entry switches the panel between a long and a short, so one setup covers both directions without a second input.
What Goes Into The Cost
The stop distance is only part of what a losing trade costs. The spread is paid on the way in and the commission is paid on both sides, so both come out of the risk budget rather than sitting outside it.
Enter your commission per lot for the round turn and it is added to the cost of one lot. Leave IncludeSpreadInRisk on and the current spread joins it. The line marked cost per lot shows the sum, and it is the number the volume is divided by.
The Volume Your Broker Will Accept
A calculated volume of 0.4856 lots is not something you can send. The panel rounds it down to the broker's volume step, never up: rounding up would spend more than the risk you set. Both figures stay on screen, so the size of the rounding is visible rather than hidden.
The result is capped at the broker's maximum. Below the broker's minimum lot there is nothing to round to, so instead of a volume the panel prints what that minimum lot would put on this stop, and the decision is made on a number rather than on a blank. When the volume reaches the ceiling, the risk line says so in place of quietly showing a figure larger than your budget.
Margin And The Minimum Stop Distance
Margin is computed from what the symbol publishes: the initial margin per lot when your broker gives it in your account currency, otherwise contract size and price handled by the symbol's own calculation mode, with leverage where that mode uses leverage and without it where it does not. The rate is taken for the side you are trading. When the figures come out, the line shows the amount and the share of your free margin it takes; for a symbol priced in a currency other than the one your account is held in, that line stays out rather than carrying a converted guess.
Brokers also set a minimum distance for a stop, and an order with a closer stop is rejected. That distance is printed in points next to your own, and the line turns red when your stop is inside it, which is cheaper to see here than in a rejection message.
R Multiples
The panel prints price levels for the first R multiples of the trade along with what each one is worth in account currency at the accepted volume. Set how many you want to see, up to ten.
Reading The Figures From An Expert Advisor
Five values are published as indicator buffers and are available through iCustom: accepted volume (0), risk at the stop (1), cost per lot (2), margin (3), and a status code (4). The inputs carry no grouping headers, so the parameters you pass to iCustom line up with the list above them one to one, in the order printed below. The status code is zero when the figures are valid, and otherwise names the reason: no tick value from the broker, stop on the entry price, zero risk budget, zero cost per lot, or risk below one minimum lot.
Input Parameters
- RiskMode - risk as a percent of balance or as a fixed amount
- RiskPercent, RiskMoney - the risk budget itself
- RiskFromEquity - take the percent from equity instead of balance
- EntryMode - entry at market price or from the line
- StopMode - stop from the draggable line or a fixed distance in points
- StopPoints - stop distance for the fixed mode
- IncludeSpreadInRisk - take the current spread out of the risk budget
- CommissionPerLotRoundTurn - commission per lot, round turn
- TargetsToShow - how many R multiples to print
- ShowPanel, PanelCorner, PanelXOffset, PanelYOffset, PanelFontSize
- ColorGood, ColorWarn, ColorNeutral, ColorEntryLine, ColorStopLine
- ObjectPrefix - name prefix that separates this copy's lines and labels from another one
Requirements
The platform is MetaTrader 5, and the panel needs an account the terminal is logged into, because volume step, margin rate and the minimum stop distance are account and symbol properties rather than platform constants. Any symbol and any timeframe: nothing here is read from bars. Two copies can sit on one chart with different risk settings, each keeping its own lines, as long as each one gets its own ObjectPrefix. No orders are placed, and no order is ever modified.
Support
Ask in the comments of this product. Useful things to include: the symbol, your broker, and the line you think is wrong, because margin modes and stop levels differ between brokers and the answer usually lives in those three facts.
