Indicator wont display used AI to fix outdate code. simple hieken ash indy. i don't know how to code
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LimeGreen
#property indicator_width1 1
#property indicator_color2 C'40,65,140'
#property indicator_width2 1
#property indicator_color3 C'220,155,220'
#property indicator_width3 8
#property indicator_color4 LimeGreen
#property indicator_width4 8
extern int MA_Method = 1;
extern int MA_Period = 20;
extern int MA_Method2 = 1;
extern int MA_Period2 = 1;
extern bool POP_UP_Box_Alert = true;
extern bool Sound_Alert = true;
double g_ibuf_100[];
double g_ibuf_104[];
double g_ibuf_108[];
double g_ibuf_112[];
double g_ibuf_116[];
double g_ibuf_120[];
double g_ibuf_124[];
double g_ibuf_128[];
int gi_132 = 0;
string prior_text = "";
int init() {
IndicatorBuffers(8);
SetIndexStyle(0, DRAW_NONE);
SetIndexBuffer(0, g_ibuf_100);
SetIndexStyle(1, DRAW_NONE);
SetIndexBuffer(1, g_ibuf_104);
SetIndexStyle(2, DRAW_HISTOGRAM);
SetIndexBuffer(2, g_ibuf_108);
SetIndexStyle(3, DRAW_HISTOGRAM);
SetIndexBuffer(3, g_ibuf_112);
SetIndexDrawBegin(0, 5);
SetIndexBuffer(4, g_ibuf_116);
SetIndexBuffer(5, g_ibuf_120);
SetIndexBuffer(6, g_ibuf_124);
SetIndexBuffer(7, g_ibuf_128);
return (0);
}
int deinit() {
return (0);
}
int start() {
double l_ima_0;
double l_ima_8;
double l_ima_16;
double l_ima_24;
double ld_32;
double ld_40;
double ld_48;
double ld_56;
if (Bars <= 10) return (0);
gi_132 = IndicatorCounted();
if (gi_132 < 0) return (-1);
if (gi_132 > 0) gi_132--;
for (int li_64 = Bars - gi_132 - 1; li_64 >= 0; li_64--) {
l_ima_0 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_CLOSE, li_64);
l_ima_8 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_LOW, li_64);
l_ima_16 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_OPEN, li_64);
l_ima_24 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_HIGH, li_64);
ld_32 = (g_ibuf_116[li_64 + 1] + (g_ibuf_120[li_64 + 1])) / 2.0;
ld_56 = (l_ima_0 + l_ima_24 + l_ima_16 + l_ima_8) / 4.0;
ld_40 = MathMax(l_ima_24, MathMax(ld_32, ld_56));
ld_48 = MathMin(l_ima_16, MathMin(ld_32, ld_56));
if (ld_32 > ld_40) {
g_ibuf_108[li_64] = ld_32 - ld_40;
g_ibuf_112[li_64] = 0;
} else if (ld_32 < ld_48) {
g_ibuf_108[li_64] = 0;
g_ibuf_112[li_64] = ld_48 - ld_32;
} else {
g_ibuf_108[li_64] = 0;
g_ibuf_112[li_64] = 0;
}
}
if (Sound_Alert) {
if (g_ibuf_108[0] > 0) {
prior_text = "Above";
PlaySound("alert.wav");
} else if (g_ibuf_112[0] > 0) {
prior_text = "Below";
PlaySound("alert.wav");
}
}
if (POP_UP_Box_Alert) {
if (g_ibuf_108[0] > 0) {
if (prior_text != "Above") {
prior_text = "Above";
Alert("Above");
}
} else if (g_ibuf_112[0] > 0) {
if (prior_text != "Below") {
prior_text = "Below";
Alert("Below");
}}}
return (0);
};
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LimeGreen
#property indicator_width1 1
#property indicator_color2 C'40,65,140'
#property indicator_width2 1
#property indicator_color3 C'220,155,220'
#property indicator_width3 8
#property indicator_color4 LimeGreen
#property indicator_width4 8
extern int MA_Method = 1;
extern int MA_Period = 20;
extern int MA_Method2 = 1;
extern int MA_Period2 = 1;
extern bool POP_UP_Box_Alert = true;
extern bool Sound_Alert = true;
double g_ibuf_100[];
double g_ibuf_104[];
double g_ibuf_108[];
double g_ibuf_112[];
double g_ibuf_116[];
double g_ibuf_120[];
double g_ibuf_124[];
double g_ibuf_128[];
int gi_132 = 0;
string prior_text = "";
int init() {
IndicatorBuffers(8);
SetIndexStyle(0, DRAW_NONE);
SetIndexBuffer(0, g_ibuf_100);
SetIndexStyle(1, DRAW_NONE);
SetIndexBuffer(1, g_ibuf_104);
SetIndexStyle(2, DRAW_HISTOGRAM);
SetIndexBuffer(2, g_ibuf_108);
SetIndexStyle(3, DRAW_HISTOGRAM);
SetIndexBuffer(3, g_ibuf_112);
SetIndexDrawBegin(0, 5);
SetIndexBuffer(4, g_ibuf_116);
SetIndexBuffer(5, g_ibuf_120);
SetIndexBuffer(6, g_ibuf_124);
SetIndexBuffer(7, g_ibuf_128);
return (0);
}
int deinit() {
return (0);
}
int start() {
double l_ima_0;
double l_ima_8;
double l_ima_16;
double l_ima_24;
double ld_32;
double ld_40;
double ld_48;
double ld_56;
if (Bars <= 10) return (0);
gi_132 = IndicatorCounted();
if (gi_132 < 0) return (-1);
if (gi_132 > 0) gi_132--;
for (int li_64 = Bars - gi_132 - 1; li_64 >= 0; li_64--) {
l_ima_0 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_CLOSE, li_64);
l_ima_8 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_LOW, li_64);
l_ima_16 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_OPEN, li_64);
l_ima_24 = iMA(NULL, 0, MA_Period, 0, MA_Method, PRICE_HIGH, li_64);
ld_32 = (g_ibuf_116[li_64 + 1] + (g_ibuf_120[li_64 + 1])) / 2.0;
ld_56 = (l_ima_0 + l_ima_24 + l_ima_16 + l_ima_8) / 4.0;
ld_40 = MathMax(l_ima_24, MathMax(ld_32, ld_56));
ld_48 = MathMin(l_ima_16, MathMin(ld_32, ld_56));
if (ld_32 > ld_40) {
g_ibuf_108[li_64] = ld_32 - ld_40;
g_ibuf_112[li_64] = 0;
} else if (ld_32 < ld_48) {
g_ibuf_108[li_64] = 0;
g_ibuf_112[li_64] = ld_48 - ld_32;
} else {
g_ibuf_108[li_64] = 0;
g_ibuf_112[li_64] = 0;
}
}
if (Sound_Alert) {
if (g_ibuf_108[0] > 0) {
prior_text = "Above";
PlaySound("alert.wav");
} else if (g_ibuf_112[0] > 0) {
prior_text = "Below";
PlaySound("alert.wav");
}
}
if (POP_UP_Box_Alert) {
if (g_ibuf_108[0] > 0) {
if (prior_text != "Above") {
prior_text = "Above";
Alert("Above");
}
} else if (g_ibuf_112[0] > 0) {
if (prior_text != "Below") {
prior_text = "Below";
Alert("Below");
}}}
return (0);
};