//+------------------------------------------------------------------+ //| Custom Stochastic-X8.4.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //| Make in Russia by lukas1 aka Victor Lukashuk / lukas1@ngs.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 LimeGreen #property indicator_level1 35 #property indicator_level2 15 #property indicator_level3 -15 #property indicator_level4 -35 #property indicator_maximum 50 #property indicator_minimum -50 //---- indicator parameters extern int Stoch_D=10; //parameter of D stoch. extern int Stoch_K=1; //parameter of signal line. extern int Stoch_S=5; //parameter of S stoch. extern double Koef=1.2; //---- indicator buffers double Buf7[],Buf8[]; double D10,D11,D12,D13,D14,D15,D16,D17; double K10,K11,K12,K13,K14,K15,K16,K17; double S10,S11,S12,S13,S14,S15,S16,S17; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name=WindowExpertName(), sim=StringSetChar("",0,164); //---- indicator short name IndicatorShortName(StringConcatenate(short_name,sim, DoubleToStr(Koef,1),": (",Stoch_D,", ",Stoch_K,", ", Stoch_S,") ",sim )); D10=Stoch_D;D11=D10*Koef;D12=D11*Koef;D13=D12*Koef; D14=D13*Koef;D15=D14*Koef;D16=D15*Koef;D17=D16*Koef; K10=Stoch_K;K11=K10*Koef;K12=K11*Koef;K13=K12*Koef; K14=K13*Koef;K15=K14*Koef;K16=K15*Koef;K17=K16*Koef; S10=Stoch_S;S11=S10*Koef;S12=S11*Koef;S13=S12*Koef; S14=S13*Koef;S15=S14*Koef;S16=S15*Koef;S17=S16*Koef; IndicatorDigits(1); SetIndexBuffer(0,Buf7); SetIndexLabel (0,"Summa of Stochs\n"); SetIndexStyle (0, 2, 0, 2) ; //---- initialization done return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { double m1,m2,m3,m4,m5,m6,m7,m8; int limit; int counted_bars=IndicatorCounted(); //---- last bar to be recounting ---- if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- base circle ---- for(int i=0; i