//+------------------------------------------------------------------+ //| | //| Copyright © 2000-2007, MetaQuotes Software Corp. | //| http://www.metaquotes.ru | //+------------------------------------------------------------------+ #property copyright "Weld" #property link "http://weld.torguem.net" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Magenta //---- input parameters extern int Depth=15; extern int Input_Price_Customs=2; //Выбор цен, по которым производится расчёт индикатора //(0-"Close", 1-"Open", 2-"High+Low", 3-"High", 4-"Low", 5-"Open+High+Low+Close", 6-Open+Close", по умолчанию-2.) //---- buffers double JCFBaux[]; double Series_[]; //---- int Bar,jrc07,Tnew,T0,T1,x; double jrc04,jrc05,jrc06,jrc08,jrc03,jrc13,JRC04,JRC05,JRC06,Value; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { //---- indicators int draw_begin;draw_begin=Depth; SetIndexDrawBegin(0,draw_begin); SetIndexStyle(0,DRAW_LINE); IndicatorBuffers(2); SetIndexBuffer(0,JCFBaux); SetIndexBuffer(1,Series_); SetIndexLabel(0,"JCFBaux"); IndicatorShortName("JCFBaux"); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit-=1+Depth; if(limit<0) return; //---- //Tnew=Time[limit+1]; //--- восстановление переменных //if((Tnew!=T0)&&(limit!=Bars-1))if (Tnew==T1){jrc04=JRC04; jrc05=JRC05; jrc06=JRC06;}else return(-1); //--- switch(Input_Price_Customs) { //---- Выбор цен, по которым производится расчёт индикатора case 0:for(x=limit; x>=0; x--)Series_[x]=Close[x];break; case 1:for(x=limit; x>=0; x--)Series_[x]=Open [x];break; case 2:for(x=limit; x>=0; x--)Series_[x]=High [x]+Low [x];break; case 3:for(x=limit; x>=0; x--)Series_[x]=High [x];break; case 4:for(x=limit; x>=0; x--)Series_[x]=Low [x];break; case 5:for(x=limit; x>=0; x--)Series_[x]=Open [x]+High [x]+Low[x]+Close[x];break; case 6:for(x=limit; x>=0; x--)Series_[x]=Open [x]+Close[x];break; default :for(x=limit; x>=0; x--)Series_[x]=High [x]+Low [x];break; //---- } for(Bar=limit;Bar>=0;Bar--) { //---- if(Bar>=Bars-Depth*2) { jrc04=0.0;jrc05=0.0;jrc06=0.0; //---- for(jrc07=Depth-1;jrc07>=0;jrc07--) { jrc04=jrc04 + MathAbs(Series_[Bar+jrc07] - Series_[Bar+jrc07+1]); jrc05=jrc05 + (Depth + jrc07) * MathAbs(Series_[Bar+jrc07] - Series_[Bar+jrc07+1]); jrc06=jrc06 + Series_[Bar+jrc07+1]; } } if(Bar