Indicators Used
0
Views
0
Downloads
0
Favorites
MTF_CCI_5TF_X5
//+------------------------------------------------------------------+
//| MTF_CCI_5TFx5 based: #RSI-3TF.mq4 ki |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//| |
//| 29.10.2005 Ìîäåðíèçàöèÿ Êèì Èãîðü Â. aka KimIV |
//| http://www.kimiv.ru |
//|code change by Alex.Piech.FinGeR mod. fx-tsd.com fxbs thx2mladen |
//|http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Red
#property indicator_color2 Gold
#property indicator_color3 Blue
#property indicator_color4 DodgerBlue
#property indicator_color5 MediumSeaGreen
#property indicator_width1 3
#property indicator_width2 3
#property indicator_width3 3
#property indicator_width4 2
#property indicator_width5 1
#property indicator_level1 200
#property indicator_level2 150
#property indicator_level3 100
#property indicator_level4 50
#property indicator_level5 -50
#property indicator_level6 -100
#property indicator_level7 -150
#property indicator_level8 -200
#property indicator_levelcolor DarkSlateGray
#property indicator_levelstyle 4
//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern color CCI1_color = Red;
extern int TF_1 = 1440;
extern int CCI1_Period = 14;
extern color CCI2_color = Gold;
extern int TF_2 = 240;
extern int CCI2_Period = 14;
extern color MA3_color = Blue;
extern int TF_3 = 60;
extern int CCI3_Period = 14;
extern color CCI4_color = DodgerBlue;
extern int TF_4 = 30;
extern int CCI4_Period = 14;
extern color CCI5_color = MediumSeaGreen;
extern int TF_5 = 0;
extern int CCI5_Period = 14;
extern string note = "1,5,15,30M30,60H1,240H4,1440D1,10080W1,43200MN1, 0-current TF";
extern string colors = "InputsTabColors-4refrenceOnly";
//---
extern int CCI1_applied_price=0;
extern int CCI1_xShift=0;
extern int CCI2_applied_price=0;
extern int CCI2_xShift=0;
extern int CCI3_applied_price=0;
extern int CCI3_xShift=0;
extern int CCI4_applied_price=0;
extern int CCI4_xShift=0;
extern int CCI5_applied_price=0;
extern int CCI5_xShift=0;
extern int NumberOfBars = 1500; // Êîëè÷åñòâî áàðîâ îáñ÷¸òà (0-âñå)
//---- input parameters
/*************************************************************************
PERIOD_M1 1
PERIOD_M5 5
PERIOD_M15 15
PERIOD_M30 30
PERIOD_H1 60
PERIOD_H4 240
PERIOD_D1 1440
PERIOD_W1 10080
PERIOD_MN1 43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
---------------------------------------
PRICE_CLOSE 0 Close price.
PRICE_OPEN 1 Open price.
PRICE_HIGH 2 High price.
PRICE_LOW 3 Low price.
PRICE_MEDIAN 4 Median price, (high+low)/2.
PRICE_TYPICAL 5 Typical price, (high+low+close)/3.
PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.
You must use the numeric value of the Applied Price that you want to use
when you set the 'applied_price' value with the indicator inputs.
**************************************************************************/
//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Buffer5[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void init() {
string short_name;
if(TF_1==0) TF_1 = Period();
if(TF_2==0) TF_2 = Period();
if(TF_3==0) TF_3 = Period();
if(TF_4==0) TF_4 = Period();
if(TF_5==0) TF_5 = Period();
if (TF_1 <= Period()) TF_1 = Period();
if (TF_2 <= Period()) TF_2 = Period();
if (TF_3 <= Period()) TF_3 = Period();
if (TF_4 <= Period()) TF_4 = Period();
if (TF_5 <= Period()) TF_5 = Period();
//---- indicator line
SetIndexStyle (0, DRAW_LINE);
SetIndexBuffer(0, Buffer1);
SetIndexStyle (1, DRAW_LINE);
SetIndexBuffer(1, Buffer2);
SetIndexStyle (2, DRAW_LINE);
SetIndexBuffer(2, Buffer3);
SetIndexStyle (3, DRAW_LINE);
SetIndexBuffer(3, Buffer4);
SetIndexStyle (4, DRAW_LINE);
SetIndexBuffer(4, Buffer5);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("MTF_CCI_5TFx5 |");
//----
SetIndexLabel(0,"CCI1["+TF_1+"]("+CCI1_Period+";"+CCI1_applied_price+")");
SetIndexLabel(1,"CCI2["+TF_2+"]("+CCI2_Period+";"+CCI2_applied_price+")");
SetIndexLabel(2,"CCI3["+TF_3+"]("+CCI3_Period+";"+CCI3_applied_price+")");
SetIndexLabel(3,"CCI4["+TF_4+"]("+CCI4_Period+";"+CCI4_applied_price+")");
SetIndexLabel(4,"CCI5["+TF_5+"]("+CCI5_Period+";"+CCI5_applied_price+")");
//----
SetIndexShift(0,CCI1_xShift);
SetIndexShift(1,CCI2_xShift);
SetIndexShift(2,CCI3_xShift);
SetIndexShift(3,CCI4_xShift);
SetIndexShift(4,CCI5_xShift);
//----
SetIndexDrawBegin(0,CCI1_Period);
SetIndexDrawBegin(1,CCI2_Period);
SetIndexDrawBegin(2,CCI3_Period);
SetIndexDrawBegin(3,CCI4_Period);
SetIndexDrawBegin(4,CCI5_Period);
}
//+------------------------------------------------------------------+
//| MTF_5TF |
//+------------------------------------------------------------------+
void start() {
int LoopBegin, sh, nsb1,nsb2,nsb3,nsb4,nsb5;
// if (NumberOfBars==0) LoopBegin=Bars-1;
// else LoopBegin=NumberOfBars-1;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
LoopBegin=Bars-counted_bars;
LoopBegin=MathMax(LoopBegin, TF_1/Period());
LoopBegin=MathMax(LoopBegin, TF_2/Period());
LoopBegin=MathMax(LoopBegin, TF_3/Period());
LoopBegin=MathMax(LoopBegin, TF_4/Period());
LoopBegin=MathMax(LoopBegin, TF_5/Period());
LoopBegin=MathMin(LoopBegin, NumberOfBars);
for (sh=LoopBegin; sh>=0; sh--) {
nsb1=iBarShift(NULL, TF_1, Time[sh], False);
nsb2=iBarShift(NULL, TF_2, Time[sh], False);
nsb3=iBarShift(NULL, TF_3, Time[sh], False);
nsb4=iBarShift(NULL, TF_4, Time[sh], False);
nsb5=iBarShift(NULL, TF_5, Time[sh], False);
Buffer1[sh]=iCCI(NULL, TF_1,CCI1_Period,CCI1_applied_price, nsb1);
Buffer2[sh]=iCCI(NULL, TF_2,CCI2_Period,CCI2_applied_price, nsb2);
Buffer3[sh]=iCCI(NULL, TF_3,CCI3_Period,CCI3_applied_price, nsb3);
Buffer4[sh]=iCCI(NULL, TF_4,CCI4_Period,CCI4_applied_price, nsb4);
Buffer5[sh]=iCCI(NULL, TF_5,CCI5_Period,CCI5_applied_price, nsb5);
}
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---