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

CCheckNewCandle - MetaTrader 5용 라이브러리

조회수:
3349
평가:
(24)
게시됨:
2017.08.10 12:38
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

An MQL4 version is also available. In this MQL5 version, I added a convenient use of "+"operators and indexing "[]". "+" allows updating flags of candlestick emergence. Indexing allows checking the emergence of a candlestick of the specified timeframe.

Many MQL5 programs explicitly execute part of their code only after the appearance of a new candlestick on the chart. This class saves you from the need to write candlestick monitoring functions in each program.

To use the class, save the attached file to %TerminalPath%\MQL4\Include\ 

Include this file in the required indicator or Expert Advisor:

#include <СCheckNewCandle.mqh>

Create an object:

CCheckNewCandle candle;

// or

CCheckNewCandle candle("EURUSD");

At the beginning of the event processing function, the emergence of new candlesticks is checked (the check result is stored in an instance).

OnTick() //or OnCalculate(), or another function...
  {
  +candle;
  ...
  }  

Now, until the next check, the candle[ENUM_TIMEFRAMES timeframe] method returns the result of the previous check using the +candle; method.

if(candle[PERIOD_H1]) //Any standard timeframe.
   {
    ...
   }
if(candle[PERIOD_D1]) //Any number of requests between the calls of +candle;.
   {
    ...
   }

P.S. The +candle; call should be performed during program initialization.

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

QEMA_HTF QEMA_HTF

The QEMA indicator with the timeframe selection option available in the indicator input parameters.

PEMA_HTF PEMA_HTF

The PEMA indicator with the timeframe selection option available in input parameters.

EveningStar EveningStar

The indicator shows the "Evening Star" pattern.

EveningStar EveningStar

The EveningStar Expert Advisor trades the "Evening Star" pattern. Lot is calculated based on the risk value as a percentage of free margin.