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

Same H4 and D1 candles on every broker - NY close candles from H1 - MetaTrader 5용 라이브러리

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

A D1 or H4 candle starts at a different moment on a UTC+0 server than on a UTC+2 server. So a moving average or ATR on H4/D1 gives other values, and the same EA trades differently from broker to broker. Most gold and forex brokers run on New York close (UTC+2, UTC+3 while the US is on summer time), but not all of them.

This include builds the big candles itself from H1 bars, always on the New York close clock. On a NY close broker the candles are the same as the MT5 ones. On any other broker you get the candles you would see on a NY close broker.

LS_ClockInit(setting, fixedUtc) detects the server clock:

  • live from TimeTradeServer() - TimeGMT(), rounded to hours
  • in the strategy tester TimeGMT() is not usable, there you choose the clock (default NY close)
  • knows NY close, UTC+2/+3 with EU summer time, Central Europe UTC+1/+2 and any fixed offset
LS_NYBars bars;
bars.Init(_Symbol, PERIOD_D1);   // OnInit, loads the H1 history
if(bars.Update()) { ... }        // OnTick, true when a candle has just closed
bars.Close(1), bars.High(1) ...  // shift 1 = last closed candle
bars.TimeNY(1)                   // open time on the NY clock
bars.Closes(arr, 200)            // closes as array for your own indicator code

Works for H2, H3, H4, H6, H8, H12 and D1. Only H1 bars that really exist go into a candle, weekends and holidays are not filled. A candle counts as closed when the first H1 bar of the next one opens.

The demo EA opens no trades. It prints the detected clock, the last broker candles next to the NY close candles, and one line every time a new one closes. The screenshot: the same XAUUSD tick data once on a NY close server and once on a CET server (tester). On the CET server the MT5 H4 candles are different, the candles from LS_NYBars match the NY close server (the small rest is the different spread of the two test symbols).

Can I trade right now - session, session end and quote check in one call Can I trade right now - session, session end and quote check in one call

One call before you send an order: is the session open, how long until it closes, are quotes still coming in, is trading allowed. Gives you the reason when the answer is no.

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.

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.

Robustness Lab: Seasonality heatmap with t-statistics (hour x weekday) Robustness Lab: Seasonality heatmap with t-statistics (hour x weekday)

Shows how a symbol has behaved in every hour of every weekday, as a heatmap on the chart. Colour the cells by t-statistic, mean return, hit rate or average range. Cells that pass a significance threshold get a gold frame, and the panel tells you how many cells would pass that threshold by chance alone, so a single lucky hour is not mistaken for an edge. Hover any cell for its full numbers. Part of the free Robustness Lab set.