/*
Generated by EX4-TO-MQ4 decompiler V4.0.220.2c []
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright "Copyright � 2006 "
#property link "http://www.anginkuskus.com/"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_color3 Red
#property indicator_color4 Lime
extern int MaMetod = 1;
extern int MaPeriod = 40;
double g_ibuf_84[];
double g_ibuf_88[];
double g_ibuf_92[];
double g_ibuf_96[];
int gi_100 = 0;
int init() {
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2, Red);
SetIndexBuffer(0, g_ibuf_84);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2, Lime);
SetIndexBuffer(1, g_ibuf_88);
SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 3, Red);
SetIndexBuffer(2, g_ibuf_92);
SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 3, Lime);
SetIndexBuffer(3, g_ibuf_96);
SetIndexDrawBegin(0, 5);
SetIndexBuffer(0, g_ibuf_84);
SetIndexBuffer(1, g_ibuf_88);
SetIndexBuffer(2, g_ibuf_92);
SetIndexBuffer(3, g_ibuf_96);
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_100 = IndicatorCounted();
if (gi_100 < 0) return (-1);
if (gi_100 > 0) gi_100--;
for (int li_64 = Bars - gi_100 - 1; li_64 >= 0; li_64--) {
l_ima_0 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_CLOSE, li_64);
l_ima_8 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_LOW, li_64);
l_ima_16 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_OPEN, li_64);
l_ima_24 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_HIGH, li_64);
ld_32 = (g_ibuf_92[li_64 + 1] + (g_ibuf_96[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_56) {
g_ibuf_84[li_64] = ld_48;
g_ibuf_88[li_64] = ld_40;
} else {
g_ibuf_84[li_64] = ld_40;
g_ibuf_88[li_64] = ld_48;
}
g_ibuf_92[li_64] = ld_32;
g_ibuf_96[li_64] = ld_56;
}
return (0);
}