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

For the indicators and Expert Advisors it's very often necessary the information whether a new bar has appeared on the specified timeframe. Here is an example, how it can be done.

After the first call of the isNewBar() function, the current bar is not assumed as a new bar. The function saves its time, it's the current bars, the next bar will be new.
The code is commented, it's easy to understand, I hope it will be useful.

Take care of use of the method, that is widely used in MQL4 - the bars counting using the Bars function (discussed here in Russian).

In MQL5 It will work only if the max bars in chart is set as Unlimited:

isNewBar

In this case, when the new bars appeared, the Bars function will return the increasing number of bars, but if the max bars in chart is limited (for example, 10000 bars), this approach will not work! It easy to check it.

That's why it's necessary to save the times of the last bars and compare them, because the time isn't changes until the bar completed.
This method is used in the indicator.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/107

Bollinger Bandwidth 1.0 for MetaTrader 5 Bollinger Bandwidth 1.0 for MetaTrader 5

The indicator Measures the distance between the Bollinger Bands ® and providing it as a singular indicator, using the MetaTrader 5 techniques to simplify Bollinger calculations.

Clipboard Clipboard

The script gets contents from the Windows Clipboard.

Setka (grid) Setka (grid)

The purpose of this grid is to replace the standard grid with more convenient, it allows to determine many important points on the chart, the properties of the price movement and checkinh the quotes quality (for the presence of holes).

Rabbit Rabbit

The Rabbit indicator plots the true support/resistance levels for any currency pair.