거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

Restart-Safe EA Template - no duplicate entries after a restart - MetaTrader 5용 expert

Jefry Francisco Rodriguez Campos
Jefry Francisco Rodriguez Campos
MQL4/MQL5 developer - Expert Advisors, indicators and strategy validation
I build clean, well-tested Expert Advisors and indicators for MetaTrader 4 and 5, with a focus on rule-based strategies and solid risk management.
What I can do for you:
조회수:
111
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Restart-Safe EA Template is a clean Expert Advisor skeleton that shows execution practices many EAs miss. The most common problem it solves: after MetaTrader or the VPS restarts, the EA sees the same signal again and opens a duplicate trade.

  • Signals are evaluated only on closed bars and only once per bar.
  • The last processed bar is stored in a terminal global variable, so a restart never repeats a signal.
  • One position per symbol and magic number, recognised again after a restart.
  • Spread filter, broker stop-level check and volume normalisation.
  • Every decision (entry sent, signal skipped and why, broker retcode) is written to the Experts log.

The included signal is a simple moving-average cross for demonstration only: replace the GetSignal() function with your own rules. This is an educational template, not a profitable strategy. Suggested for testing: EURUSD M15.

Inputs

  • Fast and slow MA periods and MA method (demo signal).
  • Lot size, stop loss and take profit in points (0 = none).
  • Maximum spread in points, magic number and maximum deviation.

Screenshot: Experts log in the Strategy Tester showing entries and skipped signals with their reason.

Experts log of the Restart-Safe EA Template in the Strategy Tester

Spread ATR Monitor - current, average and max spread vs ATR Spread ATR Monitor - current, average and max spread vs ATR

Shows the current spread next to its recent average and maximum and compares it with ATR, so you can see at a glance when trading costs are too high relative to the symbol's normal movement.

Risk Lot Panel - position size by risk and stop distance Risk Lot Panel - position size by risk and stop distance

On-chart panel that calculates the lot size for a given risk (% of balance, % of equity or fixed money) and stop-loss distance, using the broker's tick size and tick value. Works on forex, metals, indices and crypto.

Prop-firm Guard - daily loss and max drawdown protection for challenge accounts Prop-firm Guard - daily loss and max drawdown protection for challenge accounts

Watches the whole account and closes everything before the daily loss or max drawdown limit is breached, then keeps the account flat until the block ends. Does not trade.

Leverage Monitor – Real Leverage, Margin Tiers, Swap, Commission and Spread Leverage Monitor – Real Leverage, Margin Tiers, Swap, Commission and Spread

See the real leverage of every Market Watch symbol, including floating margin tiers, with swap, commission and live spread in one panel.