One Shot Panel Lot Size Calculator and Stop Guard
- Utilitários
-
Keiki Ishii
Independent MQL5 developer from Japan.
I build tools for MetaTrader 5 traders: risk managers, indicators and Expert Advisors.
How I work:
- Every product is tested in the Strategy Tester and on demo accounts (hedging and netting) before release. - Versão: 1.2
- Ativações: 5
One Shot Panel is an order panel for manual traders. One click sends one market order with a stop loss, with the lot calculated from your risk and your stop distance. It refuses the orders that usually make a losing day worse: removing or widening a stop, adding to a losing position, and a bigger lot right after a loss. It has no trading idea of its own.
You decide when to buy or sell. The panel does the arithmetic and keeps the rules you set while you are calm.
Order buttons
-
BUY and SELL: one click = one market order, always with a stop loss. A failed order is not sent again automatically. A short pause (default 3 s) stops double clicks.
-
Risk: percent of balance, percent of equity, or a fixed amount in the account currency. Change it on the panel.
-
Stop distance: pips, points, ATR multiple, or a line on the chart that you drag. Change it on the panel.
-
Take profit: optional, as a multiple of the stop distance (R). 0 = none.
-
Confirmation dialog before each order (can be turned off). It shows the lot, stop, target, the loss at the stop in money and percent, and the margin. If the price moves while the dialog is open, the lot is calculated again and never goes above the lot you confirmed.
Lot calculation
The loss for 1.00 lot at the stop comes from the terminal (OrderCalcProfit), so the currency conversion is done by MetaTrader. Commission can be added. The lot is your risk divided by that loss, rounded down to the volume step and capped at the maximum volume. The panel checks the minimum volume, the volume limit of the symbol, the stop level, the free margin and the server check (OrderCheck) before sending.
When the lot would be below the minimum volume, or the margin is not enough, the panel does not send the order and tells you why, for example "lot rounds to 0: min 0.01 lot risks 25.00 USD" or "free margin too low".
Orders the panel refuses (each with the reason on the panel)
-
Removing or widening a stop on a panel position, from anywhere: dragging the stop on the chart, the modify dialog, or deleting it. The stop is put back. If the price has already passed the old stop, the position is closed (you can choose "put it back only" or off).
-
Break-even that would widen the stop: the BE button only moves a stop towards the entry, never away.
-
Averaging down: a new order in the same direction as a losing position on the symbol. By default only the panel's own positions count; you can include every position on the symbol. The reason names the position and its loss.
-
Martingale: right after a losing panel trade (4 hours by default, or until the next win), a lot more than 1.5 times the losing lot and a higher risk percent than that trade. A bigger lot at the same risk percent (a tighter stop) is not refused. The ratio, the time and which trades count are inputs.
-
Netting accounts: an order against the open position (it would close or reverse it), and an add that would move the position's stop further away.
-
Risk above your cap (default 5% of balance) and, optionally, cost above a percent of the stop.
-
Outside trading hours of the symbol, and optionally outside your own session (server time).
On the same panel
-
Cost now: spread plus round-trip commission, as a percent of ATR and as a percent of your stop distance, colored green, yellow or red. The same calculation as Spread ATR Gate.
-
Losing streaks: type your win rate and see the longest losing streak to expect in N trades (median and 95% point, exact calculation), and what that streak costs at your current risk. Example: at a 40% win rate, the 95% point in 100 trades is 12 losses in a row; at 1% risk per trade that is about -11.4% of the balance. The same calculation as Loss Streak Card.
-
Positions of this panel (by magic number) with BE (stop to entry), 1/2 (close half) and X (close) on each row, and Close all.
-
Recent actions: orders sent, refusals, stops put back and closes are listed at the bottom of the panel.
-
Status: READY, WAITING (account or symbol data not loaded yet; nothing is sent), INACTIVE (AutoTrading off), CLOSED (trading hours), BLOCKED (both sides refused).
Accounts and symbols
-
Works on hedging and netting accounts, any symbol the terminal can trade: forex, metals, indices, crypto. No DLL. No limit by account or symbol.
-
Values typed on the panel are kept per chart when you change the timeframe. Remove the EA or change its inputs to go back to the input values.
Strategy Tester
Buttons cannot be clicked in the Strategy Tester. Only there, One Shot Panel opens minimum-lot trades with a stop loss, buy and sell in turn, during trading hours, through the same checks as a click. This path exists for Market validation and for checking how the panel works. It is not a trading strategy, and tester results say nothing about future trading.
What it does not do
-
No signals, no automatic entries outside the Strategy Tester, no trailing stop, no grid.
-
It does not make a strategy profitable. It sizes the order you chose and refuses a few known ways to make losses bigger.
-
It cannot stop other EAs or orders placed in the terminal; its rules apply to orders sent from the panel, and the stop guard covers the panel's own positions.
Recommended use
-
One panel per symbol, or a different magic number for each panel on the same symbol.
-
Check the lot and the loss in the confirmation dialog for the first orders on a new symbol.
-
Questions and bug reports: send a private message on MQL5 with the Experts log and a screenshot.
