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

Can I trade right now - session, session end and quote check in one call - MetaTrader 5용 라이브러리

Lukas Szyry
Lukas Szyry
Gold Trading Specialist | XAUUSD Expert Advisors
MetaTrader 5용 금(XAUUSD) 규칙 기반 Expert Advisor를 개발합니다. 장기적인 계좌 성장을 위한 견고한 시스템에 집중합니다: 마틴게일 없음, 그리드 없음, 손실 시 물타기 없음.
모든 업데이트는 출시 전에 2010년부터 현재까지 XAUUSD 실제 틱 데이터로 아웃오브샘플 기간을 포함하여 테스트됩니다. 기존 사용자에게 업데이트는 항상 무료입니다.
조회수:
119
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Every EA i build needs this check before an order goes out, otherwise you get "market closed" errors in the journal or a trade opened 2 minutes before the daily close. So here it is as one small include.

LS_CanTradeNow(_Symbol, 15, 300, why) checks:

  • algo trading allowed in the terminal and for the program
  • symbol not disabled or close only
  • a trade session of the symbol is running now (server time, sessions over midnight and 24h sessions are handled)
  • the session does not end within the next x minutes (15 in the example)
  • the last quote is not older than x seconds (300 in the example)

If the answer is false, why tells you the reason, for example "market closed (no trade session now)" or "session ends in 14 min (min 15)".

The quote check is there because some brokers close earlier before holidays than their session table says. When no quotes come in for a few minutes the market is treated as closed.

The other functions can be used alone:
LS_SessionOpen(sym) - true if a session is running
LS_MinutesToSessionEnd(sym) - minutes until the close, -1 if closed. A session that ends at 24:00 and goes on at 00:00 counts as one
LS_TickAgeSeconds(sym) - seconds since the last quote
LS_SessionsText(sym, day) - the sessions of a day as text, for example 01:05-23:50

All times are broker server time. TimeTradeServer() is used, so it also works on the weekend when no ticks come in. If a symbol has no session table at all the functions dont block.

The demo EA opens no trades. It prints the sessions of the week and then one line every time the answer changes. Run it in the strategy tester over a few days with a weekend and you see the daily close and the reopen in the journal (screenshot: XAUUSD, 19.-23.11.2026).

Trend or Chop? A Variance-Ratio Scoreboard That Shows Whether Your Symbol Trends or Mean-Reverts on Each Horizon Trend or Chop? A Variance-Ratio Scoreboard That Shows Whether Your Symbol Trends or Mean-Reverts on Each Horizon

Shows whether your symbol tends to trend or to mean-revert, and on which horizon. For five horizons (2, 4, 8, 16 and 32 bars by default) the indicator computes the variance ratio: the variance of multi-bar price changes divided by the variance of one-bar changes, scaled by the horizon. A ratio above 1 means that moves tend to continue, below 1 that they tend to reverse. The lines show the ratio over a rolling window, and a panel gives a scoreboard with ratio, z-score and verdict TREND, CHOP or NOISE for the recent window and for the whole history, plus one line to paste into a comment. It is a statistics tool and gives no trade signals.

PropFirm Consistency and Drawdown Monitor PropFirm Consistency and Drawdown Monitor

Read-only PropFirm daily drawdown, trailing total drawdown, and single-day consistency cap HUD monitor with four closed-bar iCustom buffers.

Same H4 and D1 candles on every broker - NY close candles from H1 Same H4 and D1 candles on every broker - NY close candles from H1

Builds H2 to D1 candles from H1 on the New York close clock, so your indicators see the same candles on every broker, no matter which server time it uses. Detects the server clock automatically.

Risk Lot Calculator Risk Lot Calculator

Calculates the lot size for a risk % and a stop distance on any symbol, using the broker's own profit calculation, so the result is exact for forex, gold, indices, stocks and crypto.