← К каталогу
Исходный код · ID 3252

Snake CCI

snake cci(2).mq5
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Snake CCI — это пользовательский индикатор для MetaTrader 5, рассчитывающий модифицированный индикатор Commodity Channel Index (CCI) с «змеиной» сглаживающей методикой. Основной индикаторный буфер представляет собой CCI, подвергнутый взвешенному скользящему среднему с переменным периодом, что обеспечивает более плавную линию по сравнению с классическим CCI. Дополнительно рассчитывается сигнальная линия на основе скользящей средней от основного значения, а также гистограммные буферы, отображающие разницу между основным и сигнальным значениями в положительной и отрицательной области.

Получить полный код

Поиск по коду файла

#property description "Commodity Channel Index [CCI] — measures Deviation of Price from its Moving Average." 
#property description "1. Divergence appears when Price reaches new maximum,"
#property description "and CCI can not grow above previous maximums."
#property description "This classical divergence is normally followed by correction."
#property description "2. CCI usually varies in range of ?100. Values above/below ?100 inform about "
#property description "overbuying/overselling state and about probability of correcting increase." 
#property description " "
#property description "Repaints if SnakeRepaint=true..."  //&&  in MTF mode!!"   //ARROWBAR && ALERTBAR corrected for MTF."   //"Не перерисовывается в режиме MTF если RePaintMTF=false!"  //"Индикатор НЕ перерисовывается! в режиме MTF."   //"ARROWBAR и ALERTBAR скорректированы для MTF."  
#property description " "  //"ALERTBAR без корректировки на MTF."   //ARROWBAR и ALERTBAR скорректированы для MTF.
#property description "E-mail:  t*******e*@mail.ru" 
#property version  "2.69"   

#property indicator_separate_window  //chart_window 
#property indicator_buffers 8

#property indicator_color1  clrLime  //White  //LightCyan  //Gold
#property indicator_color2  clrSpringGreen  //SeaGreen  //LightSteelBlue  //DeepPink  //LightCyan  //Gold
#property indicator_color3  clrCrimson  //Brown  //DeepPink  //LightSkyBlue  //Magenta    //SkyBlue
#property indicator_color4  clrRed  //HotPink  //Magenta    //SkyBlue
#property indicator_color5  clrNONE
#property indicator_color6  clrWhite  //SkyBlue
#property indicator_color7  clrCornflowerBlue  //DarkOrange  //Gold  //Lime
#property indicator_color8  clrRed  //HotPink  //Orchid  //Gold

#property indicator_width1  3
#property indicator_width2  3
#property indicator_width3  3
#property indicator_width4  3
#property indicator_width5  3
#property indicator_width6  2
#property indicator_width7  1
#property indicator_width8  0

#property indicator_style1  STYLE_SOLID
#property indicator_style2  STYLE_SOLID
#property indicator_style3  STYLE_SOLID
#property indicator_style4  STYLE_SOLID
#property indicator_style5  STYLE_SOLID
#property indicator_style6  STYLE_SOLID
#property indicator_style7  STYLE_SOLID
#property indicator_style8  STYLE_DOT

#property indicator_levelcolor clrDarkSlateGray  //DarkSlateBlue   //C'0,66,0'  //clrDimGray  //SteelBlue  //Sienna   //C'60,61,62' //C'66,122,177'  // 
#property indicator_levelstyle STYLE_DOT

enum showCD { LINE,/*Lines*/ HISTO/*Histogram*/ };

extern int                    History  =  4567;    //288=D1/M5 //576=D2/M5; //864=D3/M5; //1152=D4/M5;  //1440=D5/M5;
extern ENUM_TIMEFRAMES      TimeFrame  =  PERIOD_CURRENT;
extern int                  CciPeriod  =  15;                 //1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181....

extern ENUM_APPLIED_PRICE    CciPrice  =  PRICE_CLOSE;

extern int                SnakePeriod  =  15;                 //0.1454, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.058, 2.618, 3.32, 4.236, 5.35, 6.853....
extern bool              SnakeRepaint  =  true;

extern int                  SigPeriod  =  15;  
extern ENUM_MA_METHOD         SigMode  =  MODE_LWMA;      

extern int                   HotLevel  =  100;  
extern showCD               ShowIndex  =  HISTO;  //LINE;
extern int                    DotCode  =  159;

double POSS1[], POSS2[], NEGG1[], NEGG2[], FAKE[];
double TEMP[], MAIN[], DOTZ[], SIGMA[];   
int cciPer, snkPer, sigPer, MAX, TFK;  string sTFR, cTFR;  datetime NewTime=0;

string sName = " ["+(string)CciPeriod+">"+(string)SnakePeriod+">"+(string)SigPeriod+"] ";

int init()
{
      // код доступен только после оплаты
   }  
   TimeFrame = fmax(TimeFrame,_Period);  TFK = TimeFrame/_Period;  sTFR = StringSubstr(EnumToString(TimeFrame),7);  cTFR = StringSubstr(EnumToString(ENUM_TIMEFRAMES(_Period)),7);  //IndikName = WindowExpertName();                                                          

   cciPer = fmax(CciPeriod,2)*1;   //Percent = fmax(1,fmin(Percent,999));    //sCoeff = fmax(sCoeff,0.1);
   snkPer = fmax(SnakePeriod,0)*1;  
   sigPer = fmax(SigPeriod,0)*TFK;  
   MAX    = cciPer+snkPer+sigPer;  //fmax(PricePeriod,PipFilter);

   IndicatorBuffers(9);   IndicatorDigits(0);   //(Digits-Digits%2);

   SetIndexBuffer(0,POSS1);    SetIndexStyle(0,sigPer>0&&ShowIndex>0?DRAW_HISTOGRAM:DRAW_NONE);     
   SetIndexBuffer(1,POSS2);    SetIndexStyle(1,sigPer>0&&ShowIndex>0?DRAW_HISTOGRAM:DRAW_NONE);     
   SetIndexBuffer(2,NEGG1);    SetIndexStyle(2,sigPer>0&&ShowIndex>0?DRAW_HISTOGRAM:DRAW_NONE);     
   SetIndexBuffer(3,NEGG2);    SetIndexStyle(3,sigPer>0&&ShowIndex>0?DRAW_HISTOGRAM:DRAW_NONE);     color fake = ChartGetInteger(0,CHART_COLOR_BACKGROUND);
   SetIndexBuffer(4,FAKE);     SetIndexStyle(4,sigPer>0&&ShowIndex>0?DRAW_HISTOGRAM:DRAW_NONE,EMPTY,EMPTY,fake);   

   SetIndexBuffer(5,MAIN);     SetIndexStyle(5,sigPer<1||ShowIndex<1?DRAW_LINE:DRAW_NONE);   
   SetIndexBuffer(6,DOTZ);     SetIndexStyle(6,DRAW_ARROW);   SetIndexArrow(6,DotCode);
   SetIndexBuffer(7,SIGMA);    SetIndexStyle(7,sigPer<1||ShowIndex<1?DRAW_LINE:DRAW_NONE);   
   SetIndexBuffer(8,TEMP);     SetIndexStyle(8,DRAW_NONE);   

   SetLevelValue(0,0);   
   SetLevelValue

Показано первые 50% кода (символов: 8223)

Открыть по тарифу

Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.

Разовая покупка файла

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
822,30₽ ≈ $10.05