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

NyTime - broker server time to New York time with US and EU daylight saving - MetaTrader 5용 라이브러리

Augusto Martin D'anna
Augusto Martin D'anna
MQL5 및 Pine Script 개발자 | 2019년부터 트레이더 | 전략 검증
트레이더로서 로봇은 그 로직만큼만 좋다는 것을 압니다. 귀하의 EA가 전략 의도대로 정확히 작동하도록 합니다.
- 검증된 변환: 전략(Pine Script, Python, NinjaTrader 또는 다른 EA)을 MQL5로 옮기고 두 버전을 거래 단위로 비교합니다.
- 정직한 테스트: 1분 데이터, 실제 스프레드·수수료·스왑, 표본 외 기간.
조회수:
269
게시됨:
cb_nytime.png (31.08 KB)
\MQL5\Include\
NyTime.mqh (4.3 KB) 조회
\MQL5\Scripts\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

NyTime.mqh converts broker server time to UTC and to New York time, with the US and European daylight saving rules. Session filters like "trade 09:30-11:00 New York" usually rely on TimeGMT(), but in the Strategy Tester TimeGMT() returns the server time, so the filter is shifted in backtests. Here you declare the server clock once and every conversion is computed from the calendar, live and in the tester.

Functions

  • ServerToUtc(srv, clock) , UtcToServer(utc, clock)
  • UtcToNy(utc) , NyToUtc(ny)
  • NyTimeFromServer(srv, clock) , ServerTimeFromNy(ny, clock)
  • IsUsSummer(utc) , IsEuSummer(utc)
  • NyMinute(ny) (minutes after 00:00 New York), NyMinuteNow(clock) , NyDayNumber(ny) , NyIsWeekday(ny)

Server clocks

  • CLOCK_NY7: New York + 7 (00:00 server = 17:00 New York), the most common one
  • CLOCK_EU: Central Europe (UTC+1, summer UTC+2)
  • CLOCK_EET: Eastern Europe (UTC+2, summer UTC+3, European dates)
  • CLOCK_UTC, and CLOCK_AUTO from TimeGMT() (live only)

Example

#include <NyTime.mqh> if(NyMinuteNow(CLOCK_NY7) >= 9 * 60 + 30) // after 09:30 New York ...

NyTimeDemo.mq5 prints the New York time of the current server time and runs self-checks, including the March week when US summer time has started and European summer time has not (the case that breaks fixed-offset filters). All checks pass live and in the Strategy Tester.

News Day Blocker - no new trades on US CPI and FOMC days News Day Blocker - no new trades on US CPI and FOMC days

Blocks new trades on US CPI and FOMC days (New York date). Built-in calendar 2015-2027, works in the Strategy Tester. Never opens trades.

No Hedge Guard - close the newer side when a buy and a sell are open on one symbol No Hedge Guard - close the newer side when a buy and a sell are open on one symbol

Closes the newer side when a buy and a sell are open on the same symbol (manual trades or any EA). For prop firm accounts that forbid hedging. Never opens trades.

Daily Loss Meter for Prop Firm Rules Daily Loss Meter for Prop Firm Rules

Shows on the chart how much of today's prop-firm daily loss limit is used. Counts closed P/L (with commission and swap) and floating P/L since the daily reset, and shows the loss so far, the money left and the equity floor. The base can be balance, equity, or the higher of the two at the reset. Colour warnings at 50% and 80%, with alerts. Display only: never trades.

Session Range Boxes with Asia Breakout Alert Session Range Boxes with Asia Breakout Alert

Draws Asia, London and New York session boxes with high/low range and an optional Asia breakout alert.