#property copyright "Copyright © 2006-07, Akuma99" #property link "http://www.beginnertrader.com " #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Green #property indicator_color2 IndianRed #property indicator_color3 DarkGreen extern string note1 = "First Stochastic"; extern int StochPeriod1 = 14; extern int DPeriod1 = 3; extern int SlowingPeriod1 = 3; double g_ibuf_96[]; double g_ibuf_100[]; double g_ibuf_104[]; int init() { IndicatorBuffers(3); SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 1, Green); SetIndexBuffer(0, g_ibuf_96); SetIndexEmptyValue(0, EMPTY_VALUE); SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 1, IndianRed); SetIndexBuffer(1, g_ibuf_100); SetIndexEmptyValue(1, EMPTY_VALUE); SetIndexStyle(2, DRAW_LINE); SetIndexBuffer(2, g_ibuf_104); return (0); } int deinit() { return (0); } int start() { int li_0 = IndicatorCounted(); IndicatorShortName("Stoch Histogram (" + StochPeriod1 + "," + DPeriod1 + "," + SlowingPeriod1 + ")"); if (li_0 < 0) return (-1); if (li_0 > 0) li_0--; int li_8 = Bars - 31; if (li_0 >= 31) li_8 = Bars - li_0 - 1; for (int l_shift_4 = li_8; l_shift_4 >= 0; l_shift_4--) { g_ibuf_104[l_shift_4] = iStochastic(NULL, 0, StochPeriod1, DPeriod1, SlowingPeriod1, MODE_SMA, 0, MODE_MAIN, l_shift_4) - 50.0; if (g_ibuf_104[l_shift_4] > 0.0) g_ibuf_96[l_shift_4] = g_ibuf_104[l_shift_4]; else if (g_ibuf_104[l_shift_4] < 0.0) g_ibuf_100[l_shift_4] = g_ibuf_104[l_shift_4]; } return (0); }