Indicators Used
0
Views
0
Downloads
0
Favorites
MTF_RSI_4TF_X4
//+------------------------------------------------------------------+
//| MTF_RSI_4x4TF based: #RSI-3TF.mq4 ik |
//| 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 |
//|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 4
#property indicator_color1 Red
#property indicator_color2 Gold
#property indicator_color3 Blue
#property indicator_color4 DodgerBlue
#property indicator_width1 3
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 1
#property indicator_level1 80
#property indicator_level2 70
#property indicator_level3 50
#property indicator_level4 30
#property indicator_level5 20
#property indicator_levelcolor SlateGray
//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern color RSI1_color = Red;
extern int TF_1 = 1440;
extern int RSI1_Period = 14;
extern color RSI2_color = Gold;
extern int TF_2 = 240;
extern int RSI2_Period = 14;
extern color MA3_color = Blue;
extern int TF_3 = 60;
extern int RSI3_Period = 14;
extern color RSI4_color = DodgerBlue;
extern int TF_4 = 0;
extern int RSI4_Period = 14;
extern string note = "60H1,240H4,1440D1,10080W1,43200MN1";
extern string colors = "InputsTabColors-4refrenceOnly";
//---
extern int RSI1_applied_price=0;
extern int RSI1_AjShift=0;
extern int RSI2_applied_price=0;
extern int RSI2_AjShift=0;
extern int RSI3_applied_price=0;
extern int RSI3_AjShift=0;
extern int RSI4_applied_price=0;
extern int RSI4_AjShift=0;
extern int NumberOfBars = 3000; // Êîëè÷åñòâî áàðîâ îáñ÷¸òà (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[];
//+------------------------------------------------------------------+
//| 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_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();
//---- 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);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("MTF_RSI_4TFx4 |");
//----
SetIndexLabel(0,"RSI1["+TF_1+"]("+RSI1_Period+";"+RSI1_applied_price+")");
SetIndexLabel(1,"RSI2["+TF_2+"]("+RSI2_Period+";"+RSI2_applied_price+")");
SetIndexLabel(2,"RSI3["+TF_3+"]("+RSI3_Period+";"+RSI3_applied_price+")");
SetIndexLabel(3,"RSI4["+TF_4+"]("+RSI4_Period+";"+RSI4_applied_price+")");
//----
SetIndexShift(0,RSI1_AjShift);
SetIndexShift(1,RSI2_AjShift);
SetIndexShift(2,RSI3_AjShift);
SetIndexShift(3,RSI4_AjShift);
//----
SetIndexDrawBegin(0,RSI1_Period);
SetIndexDrawBegin(1,RSI2_Period);
SetIndexDrawBegin(2,RSI3_Period);
SetIndexDrawBegin(3,RSI4_Period);
}
//+------------------------------------------------------------------+
//| MTF_4TF |
//+------------------------------------------------------------------+
void start() {
int LoopBegin, sh, nsb1,nsb2,nsb3,nsb4;
if (NumberOfBars==0) LoopBegin=Bars-1;
else LoopBegin=NumberOfBars-1;
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);
Buffer1[sh]=iRSI(NULL, TF_1,RSI1_Period,RSI1_applied_price, nsb1);
Buffer2[sh]=iRSI(NULL, TF_2,RSI2_Period,RSI2_applied_price, nsb2);
Buffer3[sh]=iRSI(NULL, TF_3,RSI3_Period,RSI3_applied_price, nsb3);
Buffer4[sh]=iRSI(NULL, TF_4,RSI4_Period,RSI4_applied_price, nsb4);
}
}
//+------------------------------------------------------------------+
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
---