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

ZigZagExtremaOnArray - MetaTrader 5용 라이브러리

real author
게시자:
Tobias Johannes Zimmer
조회수:
3375
평가:
(31)
게시됨:
2022.04.24 15:43
업데이트됨:
2023.08.10 13:33
\MQL5\Include\ \MQL5\Indicators\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동


int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[]) {

   int to_copy = (rates_total - prev_calculated) * (prev_calculated < rates_total) + (1) * (prev_calculated == rates_total);
   CopyBuffer(RSIHandle, 0, 0, to_copy, ExtRSIBuffer);

//--- ZigZagExtremaOnBuffer.mqh calculation function
   ZZOnBuffer(rates_total, prev_calculated, ExtRSIBuffer, ExtOutputBuffer, InpSearchMode, InpDepth, InpDeviation, InpBackstep);

   return(rates_total);
}


To get only highs or only lows there is an additional input of type EnSearchmode:

//+------------------------------------------------------------------+
//| ZigZag calculation                                               |
//+------------------------------------------------------------------+
int ZZOnBuffer(const int rates,              //On a non indicator array, Arraysize can be used as 'rates_total'
               const int calculated,
               const double &src[],         //source buffer for calculation
               double &dst[],               //destination buffer for calculation buffer
               EnSearchMode mode_search,   //Set output buffer to High only, Low only or both in
               const int &depth,
               const int &deviation,
               const int &backstep          //ZZ input parameters
              ) {      ...
                        ...

Only Highs:

only highs


Only Lows:

only lows


Both highs and lows in one buffer:

both highs and lows in one buffer (ZigZag)

It is not restricted to indicator buffers, you can use it on any array, just set "rates" to the length of the array instead of rates_total.

The absolute minimum number of bars that this function can hadle is 100. So although you can use this calculation function on an array of a few hundred bars, in indicator buffers, rates_total is usually a few thousand.


Trading Volume Line Trading Volume Line

The indicator compares OHLC prices

Detecting the start of a new bar or candle Detecting the start of a new bar or candle

Detecting the start of a new bar or candle, in the OnTick() event handler of an expert advisor.

Custom Fractals Custom Fractals

Have you ever asked yourself why it is not possible to customize fractals more? ... now it is.

SmoothStep SmoothStep

SmoothStep