Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Visualizzazioni:
3134
Valutazioni:
(24)
Pubblicato:
2017.08.10 12:38
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

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.

Tradotto dal russo da MetaQuotes Ltd.
Codice originale 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.