Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
RSI_EMA_MTF
#property copyright "Kalenzo"
#property link "bartlomiej.gorski@gmail.com"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Lime
extern int RsiPeriod = 14;
extern int MaType = 1;
extern int MaPeriod = 50;
extern int TimeFrame = 60;
double g_ibuf_92[];
double g_ibuf_96[];
double g_ibuf_100[];
double g_ibuf_104[];
int init() {
IndicatorBuffers(4);
SetIndexBuffer(0, g_ibuf_92);
SetIndexBuffer(1, g_ibuf_96);
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 1);
SetIndexBuffer(2, g_ibuf_100);
SetIndexBuffer(3, g_ibuf_104);
IndicatorShortName("MTF RSI " + tf());
return (0);
}
int deinit() {
return (0);
}
int start() {
int l_shift_0;
int l_bars_4 = Bars;
int li_8 = iBars(Symbol(), TimeFrame);
for (int li_12 = 0; li_12 < li_8; li_12++) g_ibuf_100[li_12] = iRSI(Symbol(), TimeFrame, RsiPeriod, PRICE_CLOSE, li_12);
for (int li_16 = 0; li_16 < li_8; li_16++) g_ibuf_104[li_16] = iMAOnArray(g_ibuf_100, 0, MaPeriod, 0, MaType, li_16);
for (int l_index_20 = 0; l_index_20 < l_bars_4; l_index_20++) {
l_shift_0 = iBarShift(Symbol(), TimeFrame, Time[l_index_20]);
g_ibuf_92[l_index_20] = g_ibuf_100[l_shift_0];
g_ibuf_96[l_index_20] = g_ibuf_104[l_shift_0];
}
return (0);
}
string tf() {
switch (TimeFrame) {
case PERIOD_M1:
return ("M(1)");
case PERIOD_M5:
return ("M(5)");
case PERIOD_M15:
return ("M(15)");
case PERIOD_M30:
return ("M(30)");
case PERIOD_H1:
return ("H(1)");
case PERIOD_H4:
return ("H(4)");
case PERIOD_D1:
return ("D(1)");
case PERIOD_W1:
return ("W(1)");
case PERIOD_MN1:
return ("MN(1)");
}
return ("Unknown timeframe");
}
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
---