*/
#property copyright "Copyright © "
#property link "ZX"
#property indicator_separate_window
#property indicator_levelcolor DarkGreen
#property indicator_levelstyle 0
#property indicator_buffers 6
#property indicator_color1 White
#property indicator_color2 Fuchsia
#property indicator_color3 DeepSkyBlue
#property indicator_color4 Yellow
#property indicator_color5 LimeGreen
#property indicator_color6 Black
#property indicator_level1 30.0
#property indicator_style2 2
#property indicator_level2 50.0
#property indicator_level3 70.0
extern int RSI = 9;
extern int MA1 = 4;
extern int MA2 = 3;
extern int MA3 = 3;
extern int EnvPeriod = 20;
extern int EnvDeviat = 1;
double G_ibuf_100[];
double G_ibuf_104[];
double G_ibuf_108[];
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];
int init() {
SetIndexBuffer(0, G_ibuf_104);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(1, G_ibuf_108);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(2, G_ibuf_112);
SetIndexStyle(2, DRAW_LINE);
SetIndexBuffer(3, G_ibuf_116);
SetIndexStyle(3, DRAW_LINE);
SetIndexBuffer(4, G_ibuf_120);
SetIndexStyle(4, DRAW_LINE);
SetIndexBuffer(5, G_ibuf_100);
SetIndexStyle(5, DRAW_NONE);
IndicatorShortName("freeRSI(" + RSI + ", " + MA1 + ", " + MA2 + ", " + MA3 + ", " + EnvPeriod + ", " + DoubleToStr(EnvDeviat, 2) + ")");
return (0);
}
int start() {
for (int Li_0 = 0; Li_0 < Bars; Li_0++) G_ibuf_100[Li_0] = iRSI(NULL, 0, RSI, PRICE_WEIGHTED, Li_0);
for (Li_0 = 0; Li_0 < Bars; Li_0++) {
G_ibuf_116[Li_0] = iEnvelopesOnArray(G_ibuf_100, 0, EnvPeriod, MODE_LWMA, 0, EnvDeviat, MODE_UPPER, Li_0);
G_ibuf_120[Li_0] = iEnvelopesOnArray(G_ibuf_100, 0, EnvPeriod, MODE_LWMA, 0, EnvDeviat, MODE_LOWER, Li_0);
G_ibuf_104[Li_0] = iMAOnArray(G_ibuf_100, 0, MA1, 0, MODE_LWMA, Li_0);
}
for (Li_0 = 0; Li_0 < Bars; Li_0++) G_ibuf_108[Li_0] = iMAOnArray(G_ibuf_104, 0, MA2, 0, MODE_LWMA, Li_0);
for (Li_0 = 0; Li_0 < Bars; Li_0++) G_ibuf_112[Li_0] = iMAOnArray(G_ibuf_108, 0, MA3, 0, MODE_LWMA, Li_0);
return (0);
}