#property copyright "KG" #property link "www.freedom.com" #property indicator_separate_window #property indicator_minimum 0.0 #property indicator_maximum 100.0 #property indicator_buffers 8 #property indicator_color1 Black #property indicator_color2 Black #property indicator_color3 Black #property indicator_color4 Black #property indicator_color5 Black #property indicator_color6 Black #property indicator_color7 Black #property indicator_color8 Black #property indicator_level1 50.0 extern string Indicator_ID = "KG RS GROUP V1.2a: "; int gi_84 = 0; string gs_dummy_88; string gs_dummy_96; string gs_unused_104 = "--Moving Average Types--"; string gs_unused_112 = " 0 = SMA"; string gs_unused_120 = " 1 = EMA"; string gs_unused_128 = " 2 = SMMA"; string gs_unused_136 = " 3 = LWMA"; int gi_unused_144 = 3; string gs_unused_148 = "--Applied PRICE_CLOSE Types--"; string gs_unused_156 = " 0 = close"; string gs_unused_164 = " 1 = open"; string gs_unused_172 = " 2 = high"; string gs_unused_180 = " 3 = low"; string gs_unused_188 = " 4 = median(high+low)/2"; string gs_unused_196 = " 5 = typical(high+low+close)/3"; string gs_unused_204 = " 6 = weighted(high+low+close+close)/4"; extern int Fast = 1; int gi_unused_216 = 1; extern bool USD = TRUE; extern bool JPY = TRUE; extern bool CAD = TRUE; extern bool CHF = TRUE; extern bool GBP = TRUE; extern bool AUD = TRUE; extern bool EUR = TRUE; extern bool NZD = TRUE; int g_color_252 = Green; int g_color_256 = Aqua; int g_color_260 = Red; int g_color_264 = Blue; int g_color_268 = White; int g_color_272 = DarkOrange; int g_color_276 = Purple; int g_color_280 = Teal; int gi_284 = 2; extern int All_Bars = 100; int gi_292 = 0; int gi_296 = 20; int gi_300 = 15; int g_fontsize_304 = 10; double g_ibuf_308[]; double g_ibuf_312[]; double g_ibuf_316[]; double g_ibuf_320[]; double g_ibuf_324[]; double g_ibuf_328[]; double g_ibuf_332[]; double g_ibuf_336[]; string gs_348; int init() { gs_348 = Indicator_ID; IndicatorShortName(gs_348); int li_0 = 0; if (StringFind(Symbol(), "USD", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, li_0, g_color_252); SetIndexBuffer(0, g_ibuf_308); SetIndexLabel(0, "USD"); if (StringFind(Symbol(), "JPY", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, li_0, g_color_268); SetIndexBuffer(1, g_ibuf_324); SetIndexLabel(1, "JPY"); if (StringFind(Symbol(), "CHF", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, li_0, g_color_264); SetIndexBuffer(2, g_ibuf_320); SetIndexLabel(2, "CHF"); if (StringFind(Symbol(), "CAD", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, li_0, g_color_276); SetIndexBuffer(3, g_ibuf_332); SetIndexLabel(3, "CAD"); if (StringFind(Symbol(), "GBP", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(4, DRAW_LINE, STYLE_SOLID, li_0, g_color_260); SetIndexBuffer(4, g_ibuf_316); SetIndexLabel(4, "GBP"); if (StringFind(Symbol(), "AUD", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(5, DRAW_LINE, STYLE_SOLID, li_0, g_color_272); SetIndexBuffer(5, g_ibuf_328); SetIndexLabel(5, "AUD"); if (StringFind(Symbol(), "EUR", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(6, DRAW_LINE, STYLE_SOLID, li_0, g_color_256); SetIndexBuffer(6, g_ibuf_312); SetIndexLabel(6, "EUR"); if (StringFind(Symbol(), "NZD", 0) < 0) li_0 = 1; else li_0 = gi_284; SetIndexStyle(7, DRAW_LINE, STYLE_SOLID, li_0, g_color_280); SetIndexBuffer(7, g_ibuf_336); SetIndexLabel(7, "NZD"); return (0); } int deinit() { for (int l_count_0 = 0; l_count_0 < gi_84; l_count_0++) if (!ObjectDelete(gs_348 + l_count_0)) Print("error: code #", GetLastError()); return (0); } int start() { string l_symbol_0; string l_symbol_8; string l_symbol_16; string l_symbol_24; string l_symbol_32; string l_symbol_40; string l_symbol_48; string l_symbol_56; string l_symbol_64; string l_symbol_72; string l_symbol_80; string l_symbol_88; string l_symbol_96; string l_symbol_104; string l_symbol_112; string l_symbol_120; string l_symbol_128; string l_symbol_136; string l_symbol_144; string l_symbol_152; string l_symbol_160; string l_symbol_168; string l_symbol_176; string l_symbol_184; string l_symbol_192; string l_symbol_200; string l_symbol_208; string l_symbol_216; string ls_224; double ld_244; double ld_252; double ld_260; double ld_268; double l_irsi_276; double l_irsi_284; double l_irsi_292; double l_irsi_300; double l_irsi_308; double l_irsi_316; double l_irsi_324; double l_irsi_332; double l_irsi_340; double ld_348; double ld_356; double ld_364; double l_irsi_372; double l_irsi_380; double l_irsi_388; double l_irsi_396; double l_irsi_404; double ld_412; double ld_420; double ld_428; double l_irsi_436; double l_irsi_444; double l_irsi_452; double l_irsi_460; double ld_468; double ld_476; double ld_484; double ld_492; double ld_500; double l_irsi_508; double l_irsi_516; double ld_524; double ld_532; double ld_540; double ld_548; double ld_556; double ld_564; double l_irsi_572; double ld_580; double ld_588; double ld_596; double ld_604; double ld_612; double ld_620; double ld_628; double l_irsi_636; double l_irsi_644; double l_irsi_652; double l_irsi_660; double l_irsi_668; double l_irsi_676; double l_irsi_684; int li_236 = IndicatorCounted(); if (Fast < 2) Fast = 2; if (li_236 < 0) return (-1); if (All_Bars < 1) All_Bars = Bars; if (li_236 > 0 && gi_292 > 0) li_236 -= gi_292; int li_232 = All_Bars; if (StringLen(Symbol()) == 7) { ls_224 = StringSubstr(Symbol(), 6, 1); l_symbol_0 = "AUDUSD" + ls_224; l_symbol_8 = "EURUSD" + ls_224; l_symbol_16 = "USDCHF" + ls_224; l_symbol_24 = "NZDUSD" + ls_224; l_symbol_32 = "GBPUSD" + ls_224; l_symbol_40 = "USDJPY" + ls_224; l_symbol_48 = "USDCAD" + ls_224; l_symbol_56 = "GBPJPY" + ls_224; l_symbol_64 = "EURJPY" + ls_224; l_symbol_72 = "AUDJPY" + ls_224; l_symbol_80 = "NZDJPY" + ls_224; l_symbol_88 = "CADJPY" + ls_224; l_symbol_96 = "CHFJPY" + ls_224; l_symbol_104 = "GBPAUD" + ls_224; l_symbol_112 = "EURAUD" + ls_224; l_symbol_120 = "AUDNZD" + ls_224; l_symbol_128 = "AUDCHF" + ls_224; l_symbol_136 = "AUDCAD" + ls_224; l_symbol_144 = "GBPCAD" + ls_224; l_symbol_152 = "EURCAD" + ls_224; l_symbol_160 = "NZDCAD" + ls_224; l_symbol_168 = "CADCHF" + ls_224; l_symbol_176 = "GBPNZD" + ls_224; l_symbol_184 = "EURNZD" + ls_224; l_symbol_192 = "NZDCHF" + ls_224; l_symbol_200 = "EURGBP" + ls_224; l_symbol_208 = "EURCHF" + ls_224; l_symbol_216 = "GBPCHF" + ls_224; } else { l_symbol_0 = "AUDUSD"; l_symbol_8 = "EURUSD"; l_symbol_16 = "USDCHF"; l_symbol_24 = "NZDUSD"; l_symbol_32 = "GBPUSD"; l_symbol_40 = "USDJPY"; l_symbol_48 = "USDCAD"; l_symbol_56 = "GBPJPY"; l_symbol_64 = "EURJPY"; l_symbol_72 = "AUDJPY"; l_symbol_80 = "NZDJPY"; l_symbol_88 = "CADJPY"; l_symbol_96 = "CHFJPY"; l_symbol_104 = "GBPAUD"; l_symbol_112 = "EURAUD"; l_symbol_120 = "AUDNZD"; l_symbol_128 = "AUDCHF"; l_symbol_136 = "AUDCAD"; l_symbol_144 = "GBPCAD"; l_symbol_152 = "EURCAD"; l_symbol_160 = "NZDCAD"; l_symbol_168 = "CADCHF"; l_symbol_176 = "GBPNZD"; l_symbol_184 = "EURNZD"; l_symbol_192 = "NZDCHF"; l_symbol_200 = "EURGBP"; l_symbol_208 = "EURCHF"; l_symbol_216 = "GBPCHF"; } for (int li_240 = 0; li_240 < li_232; li_240++) { if (USD) { ld_244 = 100 - iRSI(l_symbol_8, 0, Fast, PRICE_WEIGHTED, li_240); ld_252 = 100 - iRSI(l_symbol_32, 0, Fast, PRICE_WEIGHTED, li_240); ld_260 = 100 - iRSI(l_symbol_0, 0, Fast, PRICE_WEIGHTED, li_240); ld_268 = 100 - iRSI(l_symbol_24, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_276 = iRSI(l_symbol_48, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_284 = iRSI(l_symbol_16, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_292 = iRSI(l_symbol_40, 0, Fast, PRICE_WEIGHTED, li_240); } if (GBP) { l_irsi_300 = iRSI(l_symbol_32, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_308 = iRSI(l_symbol_104, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_316 = iRSI(l_symbol_176, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_324 = iRSI(l_symbol_216, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_332 = iRSI(l_symbol_144, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_340 = iRSI(l_symbol_56, 0, Fast, PRICE_WEIGHTED, li_240); ld_348 = 100 - iRSI(l_symbol_200, 0, Fast, PRICE_WEIGHTED, li_240); } if (AUD) { ld_356 = 100 - iRSI(l_symbol_104, 0, Fast, PRICE_WEIGHTED, li_240); ld_364 = 100 - iRSI(l_symbol_112, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_372 = iRSI(l_symbol_72, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_380 = iRSI(l_symbol_120, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_388 = iRSI(l_symbol_128, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_396 = iRSI(l_symbol_136, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_404 = iRSI(l_symbol_0, 0, Fast, PRICE_WEIGHTED, li_240); } if (NZD) { ld_412 = 100 - iRSI(l_symbol_176, 0, Fast, PRICE_WEIGHTED, li_240); ld_420 = 100 - iRSI(l_symbol_184, 0, Fast, PRICE_WEIGHTED, li_240); ld_428 = 100 - iRSI(l_symbol_120, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_436 = iRSI(l_symbol_80, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_444 = iRSI(l_symbol_192, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_452 = iRSI(l_symbol_160, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_460 = iRSI(l_symbol_24, 0, Fast, PRICE_WEIGHTED, li_240); } if (CAD) { ld_468 = 100 - iRSI(l_symbol_144, 0, Fast, PRICE_WEIGHTED, li_240); ld_476 = 100 - iRSI(l_symbol_152, 0, Fast, PRICE_WEIGHTED, li_240); ld_484 = 100 - iRSI(l_symbol_160, 0, Fast, PRICE_WEIGHTED, li_240); ld_492 = 100 - iRSI(l_symbol_48, 0, Fast, PRICE_WEIGHTED, li_240); ld_500 = 100 - iRSI(l_symbol_136, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_508 = iRSI(l_symbol_88, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_516 = iRSI(l_symbol_168, 0, Fast, PRICE_WEIGHTED, li_240); } if (CHF) { ld_524 = 100 - iRSI(l_symbol_216, 0, Fast, PRICE_WEIGHTED, li_240); ld_532 = 100 - iRSI(l_symbol_208, 0, Fast, PRICE_WEIGHTED, li_240); ld_540 = 100 - iRSI(l_symbol_128, 0, Fast, PRICE_WEIGHTED, li_240); ld_548 = 100 - iRSI(l_symbol_192, 0, Fast, PRICE_WEIGHTED, li_240); ld_556 = 100 - iRSI(l_symbol_168, 0, Fast, PRICE_WEIGHTED, li_240); ld_564 = 100 - iRSI(l_symbol_16, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_572 = iRSI(l_symbol_96, 0, Fast, PRICE_WEIGHTED, li_240); } if (JPY) { ld_580 = 100 - iRSI(l_symbol_56, 0, Fast, PRICE_WEIGHTED, li_240); ld_588 = 100 - iRSI(l_symbol_64, 0, Fast, PRICE_WEIGHTED, li_240); ld_596 = 100 - iRSI(l_symbol_72, 0, Fast, PRICE_WEIGHTED, li_240); ld_604 = 100 - iRSI(l_symbol_80, 0, Fast, PRICE_WEIGHTED, li_240); ld_612 = 100 - iRSI(l_symbol_96, 0, Fast, PRICE_WEIGHTED, li_240); ld_620 = 100 - iRSI(l_symbol_88, 0, Fast, PRICE_WEIGHTED, li_240); ld_628 = 100 - iRSI(l_symbol_40, 0, Fast, PRICE_WEIGHTED, li_240); } if (EUR) { l_irsi_636 = iRSI(l_symbol_8, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_644 = iRSI(l_symbol_200, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_652 = iRSI(l_symbol_64, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_660 = iRSI(l_symbol_112, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_668 = iRSI(l_symbol_184, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_676 = iRSI(l_symbol_208, 0, Fast, PRICE_WEIGHTED, li_240); l_irsi_684 = iRSI(l_symbol_152, 0, Fast, PRICE_WEIGHTED, li_240); } if (USD) g_ibuf_308[li_240] = (ld_244 + ld_252 + ld_260 + ld_268 + l_irsi_284 + l_irsi_292 + l_irsi_276) / 7.0; if (EUR) g_ibuf_312[li_240] = (l_irsi_636 + l_irsi_644 + l_irsi_652 + l_irsi_660 + l_irsi_668 + l_irsi_676 + l_irsi_684) / 7.0; if (GBP) g_ibuf_316[li_240] = (l_irsi_300 + l_irsi_340 + l_irsi_308 + l_irsi_316 + l_irsi_324 + l_irsi_332 + ld_348) / 7.0; if (AUD) g_ibuf_328[li_240] = (ld_356 + ld_364 + l_irsi_372 + l_irsi_380 + l_irsi_388 + l_irsi_396 + l_irsi_404) / 7.0; if (NZD) g_ibuf_336[li_240] = (ld_412 + ld_420 + ld_428 + l_irsi_436 + l_irsi_444 + l_irsi_452 + l_irsi_460) / 7.0; if (CAD) g_ibuf_332[li_240] = (ld_468 + ld_492 + ld_476 + ld_500 + ld_484 + l_irsi_516 + l_irsi_508) / 7.0; if (CHF) g_ibuf_320[li_240] = (ld_524 + ld_532 + ld_540 + ld_548 + ld_556 + ld_564 + l_irsi_572) / 7.0; if (JPY) g_ibuf_324[li_240] = (ld_580 + ld_588 + ld_596 + ld_604 + ld_612 + ld_620 + ld_628) / 7.0; } int li_692 = gi_296; int li_696 = gi_300; if (USD) { if (g_ibuf_308[1] < g_ibuf_308[0]) sl("USD", g_ibuf_308[0], "SymbUSD", "(+)", li_692, g_color_252); if (g_ibuf_308[1] > g_ibuf_308[0]) sl("USD", g_ibuf_308[0], "SymbUSD", "(-)", li_692, g_color_252); if (g_ibuf_308[1] == g_ibuf_308[0]) sl("USD", g_ibuf_308[0], "SymbUSD", "(=)", li_692, g_color_252); li_692 += li_696; } if (JPY) { if (g_ibuf_324[1] < g_ibuf_324[0]) sl("JPY", g_ibuf_324[0], "SymbJPY", "(+)", li_692, g_color_268); if (g_ibuf_324[1] > g_ibuf_324[0]) sl("JPY", g_ibuf_324[0], "SymbJPY", "(-)", li_692, g_color_268); if (g_ibuf_324[1] == g_ibuf_324[0]) sl("JPY", g_ibuf_324[0], "SymbJPY", "(=)", li_692, g_color_268); li_692 += li_696; } if (CHF) { if (g_ibuf_320[1] < g_ibuf_320[0]) sl("CHF", g_ibuf_320[0], "SymbCHF", "(+)", li_692, g_color_264); if (g_ibuf_320[1] > g_ibuf_320[0]) sl("CHF", g_ibuf_320[0], "SymbCHF", "(-)", li_692, g_color_264); if (g_ibuf_320[1] == g_ibuf_320[0]) sl("CHF", g_ibuf_320[0], "SymbCHF", "(=)", li_692, g_color_264); li_692 += li_696; } if (CAD) { if (g_ibuf_332[1] < g_ibuf_332[0]) sl("CAD", g_ibuf_332[0], "SymbCAD", "(+)", li_692, g_color_276); if (g_ibuf_332[1] > g_ibuf_332[0]) sl("CAD", g_ibuf_332[0], "SymbCAD", "(-)", li_692, g_color_276); if (g_ibuf_332[1] == g_ibuf_332[0]) sl("CAD", g_ibuf_332[0], "SymbCAD", "(=)", li_692, g_color_276); li_692 += li_696; } if (EUR) { if (g_ibuf_312[1] < g_ibuf_312[0]) sl("EUR", g_ibuf_312[0], "SymbEUR", "(+)", li_692, g_color_256); if (g_ibuf_312[1] > g_ibuf_312[0]) sl("EUR", g_ibuf_312[0], "SymbEUR", "(-)", li_692, g_color_256); if (g_ibuf_312[1] == g_ibuf_312[0]) sl("EUR", g_ibuf_312[0], "SymbEUR", "(=)", li_692, g_color_256); li_692 += li_696; } if (GBP) { if (g_ibuf_316[1] < g_ibuf_316[0]) sl("GBP", g_ibuf_316[0], "SymbGBP", "(+)", li_692, g_color_260); if (g_ibuf_316[1] > g_ibuf_316[0]) sl("GBP", g_ibuf_316[0], "SymbGBP", "(-)", li_692, g_color_260); if (g_ibuf_316[1] == g_ibuf_316[0]) sl("GBP", g_ibuf_316[0], "SymbGBP", "(=)", li_692, g_color_260); li_692 += li_696; } if (AUD) { if (g_ibuf_328[1] < g_ibuf_328[0]) sl("AUD", g_ibuf_328[0], "SymbAUD", "(+)", li_692, g_color_272); if (g_ibuf_328[1] > g_ibuf_328[0]) sl("AUD", g_ibuf_328[0], "SymbAUD", "(-)", li_692, g_color_272); if (g_ibuf_328[1] == g_ibuf_328[0]) sl("AUD", g_ibuf_328[0], "SymbAUD", "(=)", li_692, g_color_272); li_692 += li_696; } if (NZD) { if (g_ibuf_336[1] < g_ibuf_336[0]) sl("NZD", g_ibuf_336[0], "SymbNZD", "(+)", li_692, g_color_280); if (g_ibuf_336[1] > g_ibuf_336[0]) sl("NZD", g_ibuf_336[0], "SymbNZD", "(-)", li_692, g_color_280); if (g_ibuf_336[1] == g_ibuf_336[0]) sl("NZD", g_ibuf_336[0], "SymbNZD", "(=)", li_692, g_color_280); li_692 += li_696; } return (0); } void sl(string as_0, double ad_8, string as_16, string as_24, int a_y_32, color a_color_36) { int l_window_40 = WindowFind(gs_348); string ls_44 = gs_348 + gi_84; string l_name_52 = Indicator_ID + as_16; int li_68 = a_y_32 + 15; gi_84++; string l_text_60 = as_0 + " " + as_24 + " " + DoubleToStr(ad_8, 4); if (ObjectFind(l_name_52) == -1) { if (ObjectCreate(l_name_52, OBJ_LABEL, l_window_40, 0, 0)) { ObjectSet(l_name_52, OBJPROP_XDISTANCE, 10); ObjectSet(l_name_52, OBJPROP_YDISTANCE, a_y_32); ObjectSetText(l_name_52, l_text_60, g_fontsize_304, "Arial Bold", a_color_36); } } else { ObjectSet(l_name_52, OBJPROP_XDISTANCE, 10); ObjectSet(l_name_52, OBJPROP_YDISTANCE, a_y_32); ObjectSetText(l_name_52, l_text_60, g_fontsize_304, "Arial Bold", a_color_36); } }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Implements a curve of type DRAW_LINE
Indicators Used:
Relative strength index
Custom Indicators Used:
Order Management characteristics:
Other Features: