#property copyright "Copyright © 2008, 2009 Group Three LLC" #property link "forexprofitpro.com" #property indicator_separate_window #property indicator_minimum 0.0 #property indicator_maximum 9.0 #property indicator_buffers 3 #property indicator_color1 MediumBlue #property indicator_color2 Red #property indicator_color3 LightGreen #import "GomegaAuto.dll" int InitLicense(); int CheckLicense(); bool ShowConfigBox(); #import extern color FontColor = Black; extern double Mix = 0.25; extern int TimeFrameMinutes = 0; int g_period_92 = 14; string gsa_96[16] = {"EURUSD", "GBPUSD", "AUDJPY", "USDJPY", "USDCHF", "USDCAD", "EURJPY", "EURGBP", "EURCHF", "EURAUD", "GBPJPY", "GBPCHF", "NZDCHF", "NZDJPY", "NZDUSD", "CHFJPY"}; string gsa_100[8] = {"USD", "EUR", "GBP", "CHF", "CAD", "AUD", "JPY", "NZD"}; int gi_unused_108 = 0; double g_ibuf_112[]; double g_ibuf_116[]; double g_ibuf_120[]; int gi_124; int g_period_128; string g_symbol_132; string gs_140; string gs_148; string gs_156; string gs_dummy_164; string gs_dummy_172; int init() { double ld_40; double ld_48; int li_4 = 4; int li_8 = 80; int li_12 = 12; double ld_16 = 3.2; string ls_32 = "******"; if (IsDllsAllowed() == FALSE) { Alert("Allow for DLL calls in the \'properties-->common\' popup window"); ld_40 = 0; ld_48 = 1 / ld_40; return (0); } int li_56 = InitLicense(); if (TimeFrameMinutes == 0) TimeFrameMinutes = Period(); g_period_128 = 1440 / TimeFrameMinutes; if (TimeFrameMinutes >= 1440) g_period_128 = 6; if (TimeFrameMinutes < 60 && TimeFrameMinutes >= 15) g_period_128 = 12; if (TimeFrameMinutes < 15 && TimeFrameMinutes >= 5) g_period_128 = 36; if (TimeFrameMinutes <= 1) g_period_128 = 60; int li_0 = g_period_128; PairLabel(); IndicatorBuffers(3); SetIndexBuffer(0, g_ibuf_112); SetIndexBuffer(1, g_ibuf_116); SetIndexBuffer(2, g_ibuf_120); SetIndexStyle(0, DRAW_LINE, EMPTY, 2); SetIndexStyle(1, DRAW_LINE, EMPTY, 2); SetIndexStyle(2, DRAW_HISTOGRAM); IndicatorDigits(2); SetIndexDrawBegin(0, li_0); SetIndexDrawBegin(1, li_0); SetIndexDrawBegin(2, li_0); SetIndexLabel(0, gs_148); SetIndexLabel(1, gs_156); SetIndexLabel(2, "X Spread"); SetLevelValue(0, ld_16); string l_str_concat_24 = StringConcatenate(gs_148, " ", gs_156, " (X Spread) "); IndicatorShortName(l_str_concat_24); createObj("zera", li_4, li_8 + li_12, gsa_100[0], 9, "Arial", FontColor); createObj("zerb", li_4, li_8 + li_12 * 2, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("one", li_4, li_8 + 3 * li_12, ls_32, 9, "Arial", FontColor); createObj("onea", li_4, li_8 + li_12 << 2, gsa_100[1], 9, "Arial", FontColor); createObj("oneb", li_4, li_8 + 5 * li_12, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("two", li_4, li_8 + 6 * li_12, ls_32, 9, "Arial", FontColor); createObj("twoa", li_4, li_8 + 7 * li_12, gsa_100[2], 9, "Arial", FontColor); createObj("twob", li_4, li_8 + li_12 << 3, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("thr", li_4, li_8 + 9 * li_12, ls_32, 9, "Arial", FontColor); createObj("thra", li_4, li_8 + 10 * li_12, gsa_100[3], 9, "Arial", FontColor); createObj("thrb", li_4, li_8 + 11 * li_12, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("fou", li_4, li_8 + 12 * li_12, ls_32, 9, "Arial", FontColor); createObj("foua", li_4, li_8 + 13 * li_12, gsa_100[4], 9, "Arial", FontColor); createObj("foub", li_4, li_8 + 14 * li_12, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("fiv", li_4, li_8 + 15 * li_12, ls_32, 9, "Arial", FontColor); createObj("fiva", li_4, li_8 + li_12 << 4, gsa_100[5], 9, "Arial", FontColor); createObj("fivb", li_4, li_8 + 17 * li_12, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("six", li_4, li_8 + 18 * li_12, ls_32, 9, "Arial", FontColor); createObj("sixa", li_4, li_8 + 19 * li_12, gsa_100[6], 9, "Arial", FontColor); createObj("sixb", li_4, li_8 + 20 * li_12, DoubleToStr(0.0, 2), 9, "Arial", FontColor); createObj("sev", li_4, li_8 + 21 * li_12, ls_32, 9, "Arial", FontColor); createObj("seva", li_4, li_8 + 22 * li_12, gsa_100[7], 9, "Arial", FontColor); createObj("sevb", li_4, li_8 + 23 * li_12, DoubleToStr(0.0, 2), 9, "Arial", FontColor); return (0); } int deinit() { ObjectsDeleteAll(); Comment(" "); 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() { int li_8 = IndicatorCounted(); IsLicenseValid(); if (li_8 > 0) li_8--; int li_4 = Bars - 1; for (int li_0 = MathMin(li_4 - li_8, 200); li_0 >= 0; li_0--) QuITS(li_0); return (0); } void QuITS(int a_shift_0) { double lda_16[8]; double l_istochastic_20; double l_irsi_28; double ld_36; double lda_52[16]; double lda_56[16]; int lia_68[8]; int li_8 = findCy(gs_148); int li_12 = findCy(gs_156); for (int l_index_4 = 0; l_index_4 < 16; l_index_4++) { g_symbol_132 = StringSubstr(gsa_96[l_index_4], 0, gi_124); l_istochastic_20 = 0.0; l_irsi_28 = 0.0; if (l_index_4 != 12 && l_index_4 != 13) { l_istochastic_20 = iStochastic(g_symbol_132, 0, g_period_128, 2, 2, MODE_SMA, 1, MODE_MAIN, a_shift_0); l_irsi_28 = iRSI(g_symbol_132, 0, g_period_92, PRICE_CLOSE, a_shift_0); } ld_36 = (Mix * l_istochastic_20 + (1 - Mix) * l_irsi_28) / 100.0; lda_52[l_index_4] = 9.0 * ld_36; lda_56[l_index_4] = 9 - lda_52[l_index_4]; } double ld_44 = (lda_52[3] + lda_52[4] + lda_52[5] + lda_56[0] + lda_56[1] + lda_56[14]) / 6.0; lda_16[0] = NormalizeDouble(ld_44, 2); ld_44 = (lda_52[0] + lda_52[6] + lda_52[7] + lda_52[8] + lda_52[9]) / 5.0; lda_16[1] = NormalizeDouble(ld_44, 2); ld_44 = (lda_52[1] + lda_52[10] + lda_52[11] + lda_56[7]) / 4.0; lda_16[2] = NormalizeDouble(ld_44, 2); ld_44 = (lda_52[15] + lda_56[4] + lda_56[8] + lda_56[11]) / 4.0; lda_16[3] = NormalizeDouble(ld_44, 2); ld_44 = lda_56[5] / 1.0; lda_16[4] = NormalizeDouble(ld_44, 2); ld_44 = (lda_52[2] + lda_56[9]) / 2.0; lda_16[5] = NormalizeDouble(ld_44, 2); ld_44 = (lda_56[3] + lda_56[6] + lda_56[10] + lda_56[2] + lda_56[15]) / 5.0; lda_16[6] = NormalizeDouble(ld_44, 2); ld_44 = lda_52[14]; lda_16[7] = NormalizeDouble(ld_44, 2); g_ibuf_112[a_shift_0] = lda_16[li_8]; g_ibuf_116[a_shift_0] = lda_16[li_12]; g_ibuf_120[a_shift_0] = MathAbs(lda_16[li_8] - lda_16[li_12]); for (int l_index_72 = 0; l_index_72 < 8; l_index_72++) { lia_68[l_index_72] = FontColor; if (l_index_72 == li_8) lia_68[l_index_72] = 13434880; if (l_index_72 == li_12) lia_68[l_index_72] = 255; } string l_dbl2str_60 = DoubleToStr(lda_16[0], 2); ObjectSetText("zerb", l_dbl2str_60, 9, "Arial", lia_68[0]); l_dbl2str_60 = DoubleToStr(lda_16[1], 2); ObjectSetText("oneb", l_dbl2str_60, 9, "Arial", lia_68[1]); l_dbl2str_60 = DoubleToStr(lda_16[2], 2); ObjectSetText("twob", l_dbl2str_60, 9, "Arial", lia_68[2]); l_dbl2str_60 = DoubleToStr(lda_16[3], 2); ObjectSetText("thrb", l_dbl2str_60, 9, "Arial", lia_68[3]); l_dbl2str_60 = DoubleToStr(lda_16[4], 2); ObjectSetText("foub", l_dbl2str_60, 9, "Arial", lia_68[4]); l_dbl2str_60 = DoubleToStr(lda_16[5], 2); ObjectSetText("fivb", l_dbl2str_60, 9, "Arial", lia_68[5]); l_dbl2str_60 = DoubleToStr(lda_16[6], 2); ObjectSetText("sixb", l_dbl2str_60, 9, "Arial", lia_68[6]); l_dbl2str_60 = DoubleToStr(lda_16[7], 2); ObjectSetText("sevb", l_dbl2str_60, 9, "Arial", lia_68[7]); } int findCy(string as_0) { if (as_0 == "USD") return (0); if (as_0 == "EUR") return (1); if (as_0 == "GBP") return (2); if (as_0 == "CHF") return (3); if (as_0 == "CAD") return (4); if (as_0 == "AUD") return (5); if (as_0 == "JPY") return (6); if (as_0 == "NZD") return (7); return (0); } void createObj(string a_name_0, int a_x_8, int a_y_12, string a_text_16, int a_fontsize_24, string a_fontname_28, color a_color_36 = -1) { ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0); ObjectSet(a_name_0, OBJPROP_CORNER, 1); ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_8); ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_12); ObjectSetText(a_name_0, a_text_16, a_fontsize_24, a_fontname_28, a_color_36); } void PairLabel() { string l_str_concat_0; string ls_8; gs_140 = Symbol(); gi_124 = StringLen(gs_140); gs_148 = StringSubstr(gs_140, 0, 3); gs_156 = StringSubstr(gs_140, 3, 3); if (gi_124 != 6) { ls_8 = StringSubstr(gs_140, 6, 0); for (int l_index_16 = 0; l_index_16 < 16; l_index_16++) { l_str_concat_0 = StringConcatenate(gsa_96[l_index_16], ls_8); gsa_96[l_index_16] = l_str_concat_0; } } }