Discipline of Samurai
- Utilità
- Versione: 1.0
- Attivazioni: 5
Set your rules in the morning. Discipline of Samurai keeps you to them all day.
Discipline of Samurai is a trade panel and risk manager for manual traders on MetaTrader 5. You plan a trade by dragging Entry, Stop Loss and Take Profit on the chart. The panel sizes the lot from your risk percentage, sends the order, and then enforces your daily rules across your whole account.
The difference: your settings freeze after your first trade of the day.
Cooldown, Single Position, Streak Lock, Daily Loss and Daily Target cannot be changed in either direction until the next daily reset. No raising the loss limit in the middle of a losing day. No switching off the cooldown after a loss.
Features
- Visual trade planning: drag Entry, SL and TP. Take Profit follows your R:R automatically. The lot size is calculated from your risk % and your stop distance, and adjusted to margin and broker volume limits.
- Daily Loss lock, account-wide: counts realized and floating profit and loss of the whole account, closes the positions it manages, and locks every chart running the EA until the reset. It cannot be released by hand.
- Remaining-budget check: a trade whose stop-loss loss would exceed what is left of today's Daily Loss budget is refused before it is sent. Open positions' stop-loss risk is reserved.
- Cooldown: blocks new entries for a set time after any position closes (5-minute steps).
- Single Position: only one position or pending order on the whole account.
- Streak Lock: stops new entries for the rest of the day after N losing trades in a row. A win resets the count. Break-even exits are ignored.
- Daily Target (optional): when the day's profit reaches your target, the EA closes the positions it manages and locks new entries until the reset.
- Auto Break-Even with a buffer for spread and slippage.
- Post-fill safety check: every new position must have a stop loss and the loss at the stop must match your risk. Otherwise the EA closes it and warns you.
- Market and pending orders from the same panel.
- Hide / Show tool: the lines hide automatically after an order is accepted so they cannot be dragged by mistake, and return when nothing is open.
- Save Default: store your preferred settings in a file and reload them on a new install and with the Reset button.
- Close All with a two-click confirmation (this EA's positions only).
- Win / Loss counter, Today P&L, equity and balance on the panel.
- Works on hedging and netting accounts. Tested with forex, metals and crypto symbols; test your broker and symbol type first.
How it works
- Attach the EA to a chart and set your rules before your first trade of the day.
- Drag the Stop Loss line. Check the lot size. Press BUY or SELL.
- Trade. The rules are enforced across the whole account until the next reset (default 04:00 on your computer's clock).
Who it is for
Discretionary day traders and scalpers, prop-firm challenge traders who must respect daily loss rules, and traders who know their rules but break them after a loss.
Input parameters
- Inp_Risk (0.5): risk per trade, % of balance.
- Inp_DailyLoss (3.0): Daily Loss limit, % of start-of-day balance.
- Inp_DailyProfitEnable (false) and Inp_DailyProfit (3.0): optional Daily Target, %.
- Inp_ResetHour (4): hour of the daily reset, computer time.
- Inp_CooldownEnable (false) and Inp_CooldownMin (30): cooldown in minutes.
- Inp_SinglePositionMode (false): one position on the whole account.
- Inp_StreakLockEnable (false) and Inp_StreakLimit (3): consecutive losing trades that lock the day.
- Inp_MaxSpread (0): maximum spread in points, 0 = off.
- Inp_MinMarginLevelPct (200): refuse a trade if the margin level after opening would be lower, 0 = off.
- Inp_AutoTP_RR (2.0): Take Profit as a multiple of the stop distance.
- Inp_SL_pts (0): default stop distance in points, 0 = automatic from the visible chart range.
- Inp_BE_Enable, Inp_BE_Pct, Inp_BE_Offset, Inp_BE_SpreadMult: Break-Even.
- Inp_ApplyDefaultsAtDailyReset (false): reload the saved defaults at every daily reset.
- Inp_Magic: magic number, must be greater than 0.
- Inp_AllowedSymbol: if set, the EA only runs on this symbol.
After the first start, the account-wide settings are stored in the terminal. Use the panel buttons to change them.
Please read before buying
- The EA can only stop its own new orders. It cannot block manual orders, other EAs, or the mobile app. Daily Loss and Daily Target count the whole account, but closing is limited to the positions this EA manages.
- Run one terminal per account. Two terminals on the same account do not share the daily state.
- The settings freeze is a commitment aid, not security software. Deleting terminal Global Variables bypasses it.
- The Strategy Tester simulates one chart, so the account-wide rules must be forward-tested on a demo account.
- Fast markets, gaps, slippage, broker rejections or lost connections can make a loss larger than the limit. Test on a demo account first.
Risk warning. Trading leveraged products such as forex, metals, indices and CFDs carries a high level of risk and you can lose some or all of your capital. This product is a utility. It gives no signals and no investment advice, and it does not guarantee any result. It is provided as is, and you are responsible for testing it with your broker and account type.
Support: send me a message through my MQL5 profile.
