#property copyright "Copyright © 2008, 2009 Group Three LLC" #property link "forexprofitpro.com" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 MediumBlue #property indicator_color2 Black #import "GomegaAuto.dll" int InitLicense(); int CheckLicense(); bool ShowConfigBox(); #import extern int RndmPeriod = 5; extern double RndmThresh = 60.0; double g_ibuf_88[]; double g_ibuf_92[]; int init() { double ld_0; double ld_8; if (IsDllsAllowed() == FALSE) { Alert("Allow for DLL calls in the \'properties-->common\' popup window"); ld_0 = 0; ld_8 = 1 / ld_0; return (0); } int li_16 = InitLicense(); SetIndexStyle(0, DRAW_LINE, EMPTY, 2); SetIndexBuffer(0, g_ibuf_92); IndicatorDigits(1); SetIndexStyle(1, DRAW_LINE, EMPTY, 1); SetIndexBuffer(1, g_ibuf_88); SetIndexDrawBegin(0, RndmPeriod); IndicatorShortName("Randomness"); SetIndexLabel(0, "RndmIndic"); SetIndexLabel(1, "RndmThresh"); return (0); } void IsLicenseValid() { int li_8; int li_0 = 0; int li_4 = CheckLicense(); if (li_4 == -1) Comment("Connecting to the server..."); if (li_4 == 1) { ShowConfigBox(); Comment("Invalid License. Please contact Quantum"); li_8 = 1 / li_0; } } int start() { double ld_52; double ld_60; IsLicenseValid(); if (Bars <= RndmPeriod) return (0); int l_ind_counted_8 = IndicatorCounted(); if (l_ind_counted_8 < 1) { for (int li_0 = 1; li_0 <= RndmPeriod; li_0++) { g_ibuf_88[Bars - li_0] = EMPTY_VALUE; g_ibuf_92[Bars - li_0] = EMPTY_VALUE; } } int li_12 = Bars - l_ind_counted_8; if (l_ind_counted_8 > 0) li_12++; for (int l_index_48 = 0; l_index_48 < li_12; l_index_48++) { ld_52 = Close[l_index_48] - Open[l_index_48]; ld_60 = High[l_index_48] - Low[l_index_48]; g_ibuf_88[l_index_48] = 100; if (ld_60 != 0.0) g_ibuf_88[l_index_48] = 100.0 * (ld_60 - MathAbs(ld_52)) / ld_60; } li_0 = Bars - RndmPeriod + 1; if (l_ind_counted_8 > RndmPeriod - 1) li_0 = Bars - l_ind_counted_8 - 1; while (li_0 >= 0) { g_ibuf_92[li_0] = iMAOnArray(g_ibuf_88, 0, RndmPeriod, 0, MODE_SMA, li_0); li_0--; } for (l_index_48 = 0; l_index_48 < li_12; l_index_48++) g_ibuf_88[l_index_48] = RndmThresh; return (0); }