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

Stochastic with Noise Reduction - MetaTrader 4용 지표

조회수:
44017
평가:
(8)
게시됨:
2009.11.23 11:07
업데이트됨:
2014.04.21 14:54
\MQL4\Include\
StochNR.mqh (0.85 KB) 조회
_StochNR.mq4 (3.65 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Description:

Standard Stochastic Oscillator with sensitivity feature.

It has the same parameters, as a standard Stochastic, but there is an additional "sensivity" parameter (Sens in the parameters window)

It allows to consider oscillations only below some predefined threshold, specified in points. This way we can reduce a lot of false signals.

The classical Lane Stohastic locates the current price between a maximum and a minimum prices for some number of bars, defined by %K (Kperiod) value, and it doen't distingush the difference between extremums, for example 1 point or 100 points. For these two cases the results will be the same, and we will get the overbought/oversold signals.

But using some threshold, we can consinder only significiant oscillations.

At Fig. 1 (EURUSD, 1M), the price chart, standard stochastic and the indicator proposed are presented.

Image:

Fig 1.

The indicator fields is the same as for iStochastic, the difference is that there is an additional parameter Sens - sensivity.

The output buffers are the same: 0-Stochastic value itself, 1-signal line.

double iCustom(string symbol, int timeframe, "_StochNR", int %Kperiod, int %Dperiod, 
int slowing, int method, int price_field, int Sens, int mode, int shift); // StochNR added new Sens field

double iStochastic(string symbol, int timeframe, int %Kperiod, int %Dperiod, 
int slowing, int method, int price_field, int mode, int shift) // standard stochastic 

For a practical use, it is possible to calll it as specified above, but better to perform it in another way. Just add some code to yours Stoch function:

double Stoch(int Kperiod, int Slowing, int PriceFild, double sens, int i) {  
   // maximal and minimal prices
   double max,min,c;
   for(int j=i; j<i+Slowing; j++) {
      if(PriceFild==1) { // по Close
         max+=Close[ArrayMaximum(Close,Kperiod,j)];
         min+=Close[ArrayMinimum(Close,Kperiod,j)];
        }
      else { // по High/Low
         max+=High[ArrayMaximum(High,Kperiod,j)];
         min+=Low[ArrayMinimum(Low,Kperiod,j)];
        }
      c+=Close[j];
     }
   
   double delta=max-min;
   if(delta<sens) {
      sens/=2;
      max+=sens; min-=sens;
     }
   delta=max-min;
   if(delta==0) double s0=1;
   else s0=(c-min)/delta;

   return(100*s0);
  }

It's clear, that if you need a signal line, you need an additional moving average of its value. Another way is to get it from the iCustom's 1st buffer, but it will be slow.

As you see, now the name is more informative, there is a price calculation type. If sensivity is defined greater than 0, its value is added to the oscillator's name.


Editor's remark:

Note that it's a mirror translation of the original Russian version.

If you have any questions to the author, suggestions or comments, it's better to post them there.

If you have found this code useful for trading or educational purposes, don't forget to thank author.

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

SAR Oscillator SAR Oscillator

Just Close - Parabolic SAR

Equity Recorder Equity Recorder

Record the performance of individual strategies real time in offline charts.

Opened positions indicator Opened positions indicator

It shows a brief information about all of the positions opened. It can be useful, if yours expert advisor trades many positions simultaneously.

Open and Close positions using the lines Open and Close positions using the lines

It opens and closes positions using the crossing of the movable lines.