MultiCCI_PRICE_v2

Author: Copyright � 2009, MetaQuotes Software Corp.
Indicators Used
Moving average indicator
Miscellaneous
It reads information from a fileImplements a curve of type %1
0 Views
0 Downloads
0 Favorites
MultiCCI_PRICE_v2
//+------------------------------------------------------------------+
//|                                               MultiCCI PRICE.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.mql4.com/ru/users/costy_"

#property indicator_separate_window
#property indicator_buffers 8

extern string     xxxxxxxxxxxxxxxxxxxõxxxxxxxxxx="---------------------------------------------------------";
extern string     Õ="Êîýô. Øóìà ";
extern int        X=3;
extern string     Ò="Òàéìôðåéì 0-òåêóùèé";
extern int        T=0;
extern string     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="---------------------------------------------------------";
extern string     PEriod="Ïåðèîä ÑÑI";
extern int        Ïåðèîä= 55;
extern string     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxõ="---------------------------------------------------------";
extern string     Ìåòîä_âû÷èñëåíèÿ= "0 Ïðîñò 1 Ýêñ 2 Ñãë 3 Ëèí-âçâåøåííîå";
extern int        Ìåòîä_Âû÷èñëåíèÿ=0;
extern string     xxõxxxxxxxxxxxxxxxxxxxxxxxxxxõ="---------------------------------------------------------";
extern string     Èñïîëüçóåìàÿ_öåíà= "0CLOSE,1OPEN,2HIGH,3LOW,4MEDIAN,5TYPICAL";
extern int        Èñïîëüçóåìàÿ_öeíà=4;
//----

double ma1_buffer[];double ma2_buffer[];double ma3_buffer[];double ma4_buffer[];
double ma5_buffer[];  double ma6_buffer[];  double ma7_buffer[];  double ma8_buffer[];
extern color Color1 = Red;extern color Color2 = Chocolate;extern color Color3 = Orange;
extern color Color4 = ForestGreen;extern color Color5 = RoyalBlue;extern color Color6 = Blue;
extern color Color7 = DarkOrchid;extern color Color8 = Magenta;
string Short;int Offset,SymbolsNumber; double double_bufer_8[8];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {

//----
   SetIndexBuffer(0,ma1_buffer);   SetIndexBuffer(1,ma2_buffer);   SetIndexBuffer(2,ma3_buffer);
   SetIndexBuffer(3,ma4_buffer);   SetIndexBuffer(4,ma5_buffer);   SetIndexBuffer(5,ma6_buffer);
   SetIndexBuffer(6,ma7_buffer);   SetIndexBuffer(7,ma8_buffer);
   if(WindowFind("MultiCCI PRICE #1")>0)Short="MultiCCI PRICE #2";
   else Short="MultiCCI PRICE #1";
   IndicatorShortName(Short);
   return(0);
  }
//+------------------------------------------------------------------+
int deinit()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
int SymbolsList(string &Symbols[],bool Selected)
  {
   string SymbolsFileName;
   if(Selected) SymbolsFileName = "symbols.sel";
   else         SymbolsFileName = "symbols.raw";
   int hFile=FileOpenHistory(SymbolsFileName,FILE_BIN|FILE_READ);
   if(hFile<0) return(-1);
   if(Selected) { SymbolsNumber = (FileSize(hFile) - 4) / 128; Offset = 116;  }
   else         { SymbolsNumber = FileSize(hFile) / 1936;      Offset = 1924; }
   ArrayResize(Symbols,SymbolsNumber);
   if(Selected) FileSeek(hFile,4,SEEK_SET);
   for(int i=0; i<SymbolsNumber; i++)
     {
      Symbols[i]=FileReadString(hFile,12);
      FileSeek(hFile,Offset,SEEK_CUR);
     }
   FileClose(hFile);
   return(SymbolsNumber);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   string SymbolsList[];
   if(SymbolsList(SymbolsList,true)>0)
      int pos=Bars-IndicatorCounted();
   if(IndicatorCounted()==0) pos--;
   while(pos>=0)
     {
      ma1_buffer[pos]=(iMA(SymbolsList[0],T,X,0,Ìåòîä_Âû÷èñëåíèÿ,Èñïîëüçóåìàÿ_öeíà,pos)-iMA(SymbolsList[0],T,Ïåðèîä,0,Ìåòîä_Âû÷èñëåíèÿ,Èñïîëüçóåìàÿ_öeíà,pos))/Point;
      ma2_buffer[pos] = (iMA(SymbolsList[1], T , X, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos)-iMA(SymbolsList[1], T , Ïåðèîä, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos))/Point;
      ma3_buffer[pos] = (iMA(SymbolsList[2], T , X, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos)-iMA(SymbolsList[2], T , Ïåðèîä, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos))/Point;
      ma4_buffer[pos] = (iMA(SymbolsList[3], T , X, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos)-iMA(SymbolsList[3], T , Ïåðèîä, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos))/Point;
      ma5_buffer[pos] = (iMA(SymbolsList[4], T , X, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos)-iMA(SymbolsList[4], T , Ïåðèîä, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos))/Point;
      ma6_buffer[pos] = (iMA(SymbolsList[5], T , X, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos)-iMA(SymbolsList[5], T , Ïåðèîä, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos))/Point;
      ma7_buffer[pos] = (iMA(SymbolsList[6], T , X, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos)-iMA(SymbolsList[6], T , Ïåðèîä, 0, Ìåòîä_Âû÷èñëåíèÿ, Èñïîëüçóåìàÿ_öeíà, pos))/Point;
      ma8_buffer[pos]=(iMA(SymbolsList[7],T,X,0,Ìåòîä_Âû÷èñëåíèÿ,Èñïîëüçóåìàÿ_öeíà,pos)-iMA(SymbolsList[7],T,Ïåðèîä,0,Ìåòîä_Âû÷èñëåíèÿ,Èñïîëüçóåìàÿ_öeíà,pos))/Point; pos--;
     }
   color colore[8];
   colore[0]=Color1;colore[1]=Color2;colore[2]=Color3;colore[3]=Color4;   colore[4]=Color5;colore[5]=Color6;colore[6]=Color7;colore[7]=Color8;
   int labe[8];
   labe[0]=0;   labe[1]=13;   labe[2]=26;   labe[3]=39;  labe[4]=52;   labe[5]=65;   labe[6]=78;   labe[7]=91;
   double ma_buffer[8];
   ma_buffer[0]= ma1_buffer [0];    ma_buffer[1]= ma2_buffer [0];    ma_buffer[2]= ma3_buffer [0];
   ma_buffer[3]= ma4_buffer [0];    ma_buffer[4]= ma5_buffer [0];      ma_buffer[5]= ma6_buffer [0];       ma_buffer[6]= ma7_buffer [0];  ma_buffer[7]= ma8_buffer [0];
   string text[8];
   text[0]=DoubleToStr(ma_buffer[0],2);  text[1]=DoubleToStr(ma_buffer[1],2);  text[2]=DoubleToStr(ma_buffer[2],2);
   text[3]=DoubleToStr(ma_buffer[3],2);  text[4]=DoubleToStr(ma_buffer[4],2);  text[5]=DoubleToStr(ma_buffer[5],2);  text[6]=DoubleToStr(ma_buffer[6],2);text[7]=DoubleToStr(ma_buffer[7],2);
   int òîëùèíà=1,ðàçøðèô=10;
   if(SymbolsNumber>ArraySize(labe))
     {
      SymbolsNumber=ArraySize(labe);
     }
   if(Short=="MultiCCI PRICE #1")
     {
      for(int i_4=0; i_4<SymbolsNumber; i_4++)
        {
         òîëùèíà=1;ðàçøðèô=10;
         if(SymbolsList[i_4]==Symbol()) {òîëùèíà=2;ðàçøðèô=12;}
         ObjectDelete(SymbolsList[i_4]);
         ObjectCreate(SymbolsList[i_4],OBJ_LABEL,WindowFind(Short),0,0);
         ObjectSet(SymbolsList[i_4],OBJPROP_CORNER,1);
         ObjectSet(SymbolsList[i_4],OBJPROP_YDISTANCE,labe[i_4]+5);
         ObjectSet(SymbolsList[i_4],OBJPROP_XDISTANCE,5);
         ObjectSetText(SymbolsList[i_4],text[i_4]+"   "+SymbolsList[i_4],ðàçøðèô,"Times New Roman",colore[i_4]);
         SetIndexStyle(i_4,DRAW_LINE,STYLE_SOLID,òîëùèíà,colore[i_4]);
         SetIndexLabel(i_4,SymbolsList[i_4]);
        }
     }
   else
     {
      for(i_4=0; i_4<SymbolsNumber; i_4++)
        {
         òîëùèíà=1;ðàçøðèô=10;
         if(SymbolsList[i_4]==Symbol()) {òîëùèíà=2;ðàçøðèô=12;}
         ObjectDelete(SymbolsList[i_4]+"2");
         ObjectCreate(SymbolsList[i_4]+"2",OBJ_LABEL,WindowFind(Short),0,0);
         ObjectSet(SymbolsList[i_4]+"2",OBJPROP_CORNER,1);
         ObjectSet(SymbolsList[i_4]+"2",OBJPROP_YDISTANCE,labe[i_4]+5);
         ObjectSet(SymbolsList[i_4]+"2",OBJPROP_XDISTANCE,5);
         ObjectSetText(SymbolsList[i_4]+"2",text[i_4]+"   "+SymbolsList[i_4],ðàçøðèô,"Times New Roman",colore[i_4]);
         SetIndexStyle(i_4,DRAW_LINE,STYLE_SOLID,òîëùèíà,colore[i_4]);
         SetIndexLabel(i_4,SymbolsList[i_4]);
        }
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---