거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
10388
평가:
(51)
게시됨:
2013.10.25 10:21
업데이트됨:
2016.11.22 07:32
\MQL5\Include\
ibarshift.mqh (3.24 KB) 조회
\MQL5\Scripts\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

There are a lot of users who searched for iBarShift function like in MQL4.

But this function is not included in MQL5, mainly because MQL5 provides all necessary basic, low-level, functions to process such operation in a library.

As an alternative, several programmers provided their MQL5 version. I found 4 different versions from circlesquares, komposter (from Codebase), dc2008 (from famous article Migrating from mql4 to mql5) or marketeer (Russian forum).

What I discovered, remarkably, is that all four versions are bugged, in the sense they don't reproduce exactly the MQL4 iBarShift(). Indeed, when the datetime given as input parameter, don't match with the opening of a candle, all versions return a wrong value.

So I decided to make some tests about accuracy and speed of these various functions, and of course to develop my version. You can find attached both the library with this new version, and a little script used to benchmark the functions.

Results of the iBarShift benchmark for the 5 versions.

As a side note, iBarShift() isn't always the best way to realize some task in MQL5. Depending of your algorithm, there can be better method.

Edit: 2014.10.03. Version 1.02 posted (fixed a bug if requested time is superior to last bar start time).

Price_Channel_Trend Price_Channel_Trend

Trend indicator, based on crossover of pivot level and its median.

ChandeQStick ChandeQStick

The QStick indicator is a simple n-period moving average of the price difference.

Any Pair Stochastic Any Pair Stochastic

This indicator is useful for correlation analysis and also for cross pair analysis.

Donchian Channel Donchian Channel

Donchian Channel is a volatility indicator based on the calculation of the current price range with the recent highest and lowest prices.