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

PriceChannel - MetaTrader 5용 라이브러리

조회수:
4033
평가:
(19)
게시됨:
2019.02.07 08:48
\MQL5\Include\fxsaber\PriceChannel\
Pricest.mqh (5.67 KB) 조회
Highest.mqh (0.33 KB) 조회
Lowest.mqh (0.34 KB) 조회
\MQL5\Experts\fxsaber\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

PriceChannel the highest and the lowest price over the period selected.


This cross-platform library allows computing the PriceChannel without attributing it to standard bars, i.e., by ticks.

Accordingly, PriceChannel can be computed on any timeframe, including the one-second one. It can also work as a channel on ticks.


Example.

// PriceChannel library operation sample

input int inPeriod = 1;            // Channel period
sinput bool inPriceChannel = true; // Enable/disable calculating the PriceChannel via the library

#define PRICECHANNEL_LOW_PRICE bid  // bid/ask/last for the bar Low
#include <fxsaber\PriceChannel\PriceChannel.mqh> // https://www.mql5.com/en/code/23418

// The highest price over the last iPeriod bars
double GetHigh( const int iPeriod )
{
  static double Highs[];

  CopyHigh(_Symbol, PERIOD_CURRENT, 0, iPeriod, Highs);

  return(Highs[ArrayMaximum(Highs)]);
}

// The lowest price over the last iPeriod bars
double GetLow( const int iPeriod )
{
  static double Lows[];

  CopyLow(_Symbol, PERIOD_CURRENT, 0, iPeriod, Lows);

  return(Lows[ArrayMinimum(Lows)]);
}

double Sum = 0;

void OnTick()
{
  static const int BarInterval = PeriodSeconds(PERIOD_CURRENT);
  static PRICECHANNEL PriceChannel(inPeriod); // Created a PriceChannel object with a predefined period

  static int CountBars = 0;
  static datetime PrevTime = 0;

  if (inPriceChannel)
    PriceChannel.NewTick(); // Considered the new tick

  if (TimeCurrent() / BarInterval != PrevTime / BarInterval) // New bar
    CountBars++;

  if (CountBars > MAX_BARS) // Start calculating when the relevant history has accumulated
    Sum += inPriceChannel ? PriceChannel.GetHigh() - PriceChannel.GetLow() // Calculate the PriceChannel via the library
                          :   GetHigh(inPeriod) - GetLow(inPeriod);        // Calculate the PriceChannel by standard method

  PrevTime = TimeCurrent();
}

double OnTester()
{
  return(Sum);
}

This EA will show in Tester the identical results: The standard one and that via the library.


Performance.


Standard calculations

optimization finished, total passes 200
optimization done in 6 minutes 55 seconds
shortest pass 0:00:01.061, longest pass 0:00:03.432, average pass 0:00:02.066


Via the library

optimization finished, total passes 200
optimization done in 2 minutes 57 seconds
shortest pass 0:00:00.764, longest pass 0:00:01.982, average pass 0:00:00.862


Features.

  • Calculations on every tick.
  • You can set any duration for the bar.
  • No binding to standard bars.
  • The largest default value (can be specified) is calculated by Bid, the smallest one by Ask.
  • The performance does not practically depend on the period.

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

Stochastic_RSI Stochastic_RSI

Indicator Stochastic RSI

MTF_LRMA MTF_LRMA

Indicator Multi Timeframe Linear Regression MA with signal line

MTF_Stochastic_RSI MTF_Stochastic_RSI

Indicator Multi timeframes Stochastic RSI

ZigZag_Oscillator ZigZag_Oscillator

Indicator ZigZag Oscillator