One Shot Panel Lot Size Calculator and Stop Guard

  • Yardımcı programlar
  • Keiki Ishii
    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.
  • Sürüm: 1.2
  • Etkinleştirmeler: 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.


Yazarın diğer ürünleri
Equity Guard is a risk manager for MT5. It has no trading strategy. It watches every position on your account: positions from other Expert Advisors and manual trades. When a position breaks the rules you set, Equity Guard closes it, or adds a stop loss to it. Use it next to your own EAs, or while you trade by hand. It works on hedging and netting accounts, on any symbol. What it does Daily loss limit. Set the limit in percent or in money. When today's loss reaches it, the panel turns to BLOCKED.
Spread ATR Gate shows how much of your move the trading cost takes. It has no trade signals and never trades. Spread in points does not say much on its own. 30 points is small on a 4-hour gold chart and large on a 1-minute chart. Spread ATR Gate compares the round-trip cost (spread + the commission you enter) with the average bar range (ATR) and with the target distance you plan to use, and colors the result green, yellow or red. It works on any symbol: forex (including JPY pairs), gold and othe
Loss Streak Card shows how long a losing streak is normal at your win rate, and whether your current streak is inside that range. It has no trade signals and never trades. Losing streaks come from the win rate itself. At a 35% win rate, a run of 10 losses in a row happens in about 3 out of 4 sequences of 300 trades. At a 70% win rate, 5 losses in a row still happen in more than half of the sequences of 500 trades. Traders who do not expect this often increase the lot after losses. Loss Streak Ca
News Flat marks the minutes around economic releases on your MT5 chart, and can keep your account flat during them. It has no trading strategy. It reads the economic calendar built into MetaTrader 5. For the currencies of your chart symbol, it shades a window from X minutes before to Y minutes after each important release. You choose the importance and the window length. What you do with the window is your choice: watch it, or let News Flat close trades opened inside it. News Flat does not trade
Session Cost Map draws the Tokyo, London and New York session ranges and measures what happened after a range break on your own chart history, after your trading cost. It has no trade signals and never trades. "Asian range breakout" and "London breakout" are popular ideas. Session Cost Map does not give you an arrow for them. It gives you the numbers: how many breaks there were in the loaded history, and the average move N bars later, before and after the round-trip cost. Our own measurement. In
Swap Payback is a multi-symbol table that shows how many rollover days a positive swap needs to pay back the spread. It has no trade signals and never trades. A positive swap looks attractive in the symbol specification. But you pay the spread (and maybe a commission) when you open and close. Swap Payback puts the swap and the cost side by side for many symbols at once, and counts the days. What each row shows Swap long and swap short for one rollover, in your account currency per 1.00 lot and i
Filtrele:
Değerlendirme yok
Değerlendirmeye yanıt