#property copyright "Copyright © 2008 www.ervent.net, FerruFx" #property link "http://www.ervent.net" #property indicator_chart_window extern string Label0 = "=== Multi Display on chart ==="; extern int Indicator_ID_Number = 1; extern int X_offset_comments = 0; extern int Y_offset_comments = 0; extern int X_offset_histo = 0; extern int Y_offset_histo = 0; extern string Label1 = "=== CCFp settings ==="; extern int Timeframe = 240; extern bool Use.Current = FALSE; extern bool Use.Bar.instead.of.MA = FALSE; extern int MA_Method = 3; extern int Price = 6; extern int Fast = 3; extern int Slow = 5; extern string Label2 = "=== Suggestions settings ==="; extern bool Display_suggestions = TRUE; extern int Trade_Level = 2; extern bool Use.Reverse.Suggestions = FALSE; extern bool SignalAlert = FALSE; extern bool SendAlertEmail = FALSE; extern string Label3 = "=== Trade settings ==="; extern bool Trade_EURUSD = TRUE; extern bool Trade_GBPUSD = TRUE; extern bool Trade_USDCHF = TRUE; extern bool Trade_USDJPY = TRUE; extern bool Trade_AUDUSD = TRUE; extern bool Trade_USDCAD = TRUE; extern bool Trade_EURAUD = TRUE; extern bool Trade_EURCHF = TRUE; extern bool Trade_EURGBP = TRUE; extern bool Trade_EURJPY = TRUE; extern bool Trade_GBPCHF = TRUE; extern bool Trade_GBPJPY = TRUE; extern bool Trade_AUDCAD = TRUE; extern bool Trade_AUDCHF = TRUE; extern bool Trade_AUDJPY = TRUE; extern bool Trade_AUDNZD = TRUE; extern bool Trade_CADCHF = TRUE; extern bool Trade_CADJPY = TRUE; extern bool Trade_CHFJPY = TRUE; extern bool Trade_EURCAD = TRUE; extern bool Trade_EURNZD = TRUE; extern bool Trade_NZDCAD = TRUE; extern bool Trade_NZDCHF = TRUE; extern bool Trade_NZDJPY = TRUE; extern bool Trade_NZDUSD = TRUE; extern bool Trade_GBPAUD = TRUE; extern bool Trade_GBPCAD = TRUE; extern bool Trade_GBPNZD = TRUE; extern string Label4 = "=== Squares Colors settings ==="; extern bool Display_histogram = TRUE; extern color Currency_color = Silver; extern color Values_color = Gray; extern color Buy_color1 = DarkGreen; extern color Buy_color2 = C'0x00,0x73,0x00'; extern color Buy_color3 = C'0x00,0x82,0x00'; extern color Buy_color4 = C'0x00,0x91,0x00'; extern color Buy_color5 = C'0x00,0xA0,0x00'; extern color Buy_color6 = C'0x00,0xAF,0x00'; extern color Buy_color7 = C'0x00,0xBE,0x00'; extern color Buy_color8 = C'0x00,0xCD,0x00'; extern color Buy_color9 = C'0x00,0xDC,0x00'; extern color Buy_color10 = C'0x00,0xEB,0x00'; extern color Sell_color1 = C'0x82,0x00,0x00'; extern color Sell_color2 = C'0x91,0x00,0x00'; extern color Sell_color3 = C'0xA0,0x00,0x00'; extern color Sell_color4 = C'0xAF,0x00,0x00'; extern color Sell_color5 = C'0xBE,0x00,0x00'; extern color Sell_color6 = C'0xCD,0x00,0x00'; extern color Sell_color7 = C'0xDC,0x00,0x00'; extern color Sell_color8 = C'0xEB,0x00,0x00'; extern color Sell_color9 = C'0xFA,0x00,0x00'; extern color Sell_color10 = C'0xFA,0x00,0x00'; extern string Label5 = "=== Comments Colors settings ==="; extern color Pair_color = Gainsboro; extern color BUY_color = Lime; extern color SELL_color = Red; extern color Timer_color = LightSalmon; extern color Reverse_color = Gold; int gi_416; int g_datetime_420 = 0; bool gi_424 = TRUE; string gs_428; string g_name_436; string gs_444; string gs_452; int gi_460; int gi_464; int g_count_468; bool gi_472; double gd_476; double gd_484; double gd_492; double gd_500; double gd_508; double gd_516; double gd_524; double gd_532; int gi_540; int gi_544; int gi_552; int gi_556; int gi_564; int gi_568; int gi_576; int gi_580; int gi_588; int gi_592; int gi_600; int gi_604; int gi_612; int gi_616; int gi_624; int gi_628; int g_datetime_636 = 0; int g_datetime_640 = 0; int g_datetime_644 = 0; int g_datetime_648 = 0; int g_datetime_652 = 0; int g_datetime_656 = 0; int g_datetime_660 = 0; int g_datetime_664 = 0; int init() { gs_428 = StringSubstr(Symbol(), 6, 3); if (Timeframe == 0) Timeframe = Period(); if (Timeframe == PERIOD_M1) gs_444 = "M1"; if (Timeframe == PERIOD_M5) gs_444 = "M5"; if (Timeframe == PERIOD_M15) gs_444 = "M15"; if (Timeframe == PERIOD_M30) gs_444 = "M30"; if (Timeframe == PERIOD_H1) gs_444 = "H1"; if (Timeframe == PERIOD_H4) gs_444 = "H4"; if (Timeframe == PERIOD_D1) gs_444 = "D1"; if (Timeframe == PERIOD_W1) gs_444 = "W1"; if (Timeframe == PERIOD_MN1) gs_444 = "MN"; return (0); } int deinit() { cleanup(); return (0); } int start() { int li_4; int li_8; cleanup(); if (g_datetime_636 != iTime(Symbol(), Timeframe, 0)) { g_datetime_636 = iTime(Symbol(), Timeframe, 0); g_count_468 = 0; } if (gi_424) { g_datetime_640 = iTime("EURUSD" + gs_428, Timeframe, 1); g_datetime_644 = iTime("GBPUSD" + gs_428, Timeframe, 1); g_datetime_648 = iTime("AUDUSD" + gs_428, Timeframe, 1); g_datetime_652 = iTime("NZDUSD" + gs_428, Timeframe, 1); g_datetime_656 = iTime("USDCHF" + gs_428, Timeframe, 1); g_datetime_660 = iTime("USDCAD" + gs_428, Timeframe, 1); g_datetime_664 = iTime("USDJPY" + gs_428, Timeframe, 1); gi_424 = FALSE; } if (g_datetime_640 != iTime("EURUSD" + gs_428, Timeframe, 0)) { g_datetime_640 = iTime("EURUSD" + gs_428, Timeframe, 0); g_count_468++; } if (g_datetime_644 != iTime("GBPUSD" + gs_428, Timeframe, 0)) { g_datetime_644 = iTime("GBPUSD" + gs_428, Timeframe, 0); g_count_468++; } if (g_datetime_648 != iTime("AUDUSD" + gs_428, Timeframe, 0)) { g_datetime_648 = iTime("AUDUSD" + gs_428, Timeframe, 0); g_count_468++; } if (g_datetime_652 != iTime("NZDUSD" + gs_428, Timeframe, 0)) { g_datetime_652 = iTime("NZDUSD" + gs_428, Timeframe, 0); g_count_468++; } if (g_datetime_656 != iTime("USDCHF" + gs_428, Timeframe, 0)) { g_datetime_656 = iTime("USDCHF" + gs_428, Timeframe, 0); g_count_468++; } if (g_datetime_660 != iTime("USDCAD" + gs_428, Timeframe, 0)) { g_datetime_660 = iTime("USDCAD" + gs_428, Timeframe, 0); g_count_468++; } if (g_datetime_664 != iTime("USDJPY" + gs_428, Timeframe, 0)) { g_datetime_664 = iTime("USDJPY" + gs_428, Timeframe, 0); g_count_468++; } if (g_count_468 == 7) gi_472 = TRUE; else gi_472 = FALSE; if (Use.Bar.instead.of.MA) gi_464 = 1000; else gi_464 = 10000; gd_476 = Lookup(NormalizeDouble((usdCalc(1) - usdCalc(2)) * gi_464, 0)); gi_540 = 8; gi_544 = 18; if (Display_histogram) { DrawText("USD", gi_540 + 1); DrawNum("USD", gd_476, gi_540); } gd_484 = Lookup(NormalizeDouble((eurCalc(1) - eurCalc(2)) * gi_464, 0)); gi_552 = 32; gi_556 = 18; if (Display_histogram) { DrawText("EUR", gi_552 + 1); DrawNum("EUR", gd_484, gi_552); } gd_492 = Lookup(NormalizeDouble((gbpCalc(1) - gbpCalc(2)) * gi_464, 0)); gi_564 = 56; gi_568 = 18; if (Display_histogram) { DrawText("GBP", gi_564 + 1); DrawNum("GBP", gd_492, gi_564); } gd_500 = Lookup(NormalizeDouble((audCalc(1) - audCalc(2)) * gi_464, 0)); gi_576 = 80; gi_580 = 18; if (Display_histogram) { DrawText("AUD", gi_576); DrawNum("AUD", gd_500, gi_576); } gd_508 = Lookup(NormalizeDouble((nzdCalc(1) - nzdCalc(2)) * gi_464, 0)); gi_588 = 104; gi_592 = 18; if (Display_histogram) { DrawText("NZD", gi_588); DrawNum("NZD", gd_508, gi_588); } gd_516 = Lookup(NormalizeDouble((cadCalc(1) - cadCalc(2)) * gi_464, 0)); gi_600 = 128; gi_604 = 18; if (Display_histogram) { DrawText("CAD", gi_600); DrawNum("CAD", gd_516, gi_600); } gd_524 = Lookup(NormalizeDouble((chfCalc(1) - chfCalc(2)) * gi_464, 0)); gi_612 = 152; gi_616 = 18; if (Display_histogram) { DrawText("CHF", gi_612 + 1); DrawNum("CHF", gd_524, gi_612); } gd_532 = Lookup(NormalizeDouble((jpyCalc(1) - jpyCalc(2)) * gi_464, 0)); gi_624 = 176; gi_628 = 18; if (Display_histogram) { DrawText("JPY", gi_624 + 1); DrawNum("JPY", gd_532, gi_624); } if (Display_histogram) { gi_460 = 4; for (int li_0 = 1; li_0 < 11; li_0++) { if (gd_476 < 0.0) { if (gd_476 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_476 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("usd" + li_0, gi_540, gi_544, gi_416); gi_544 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_484 < 0.0) { if (gd_484 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_484 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("eur" + li_0, gi_552, gi_556, gi_416); gi_556 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_492 < 0.0) { if (gd_492 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_492 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("gbp" + li_0, gi_564, gi_568, gi_416); gi_568 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_500 < 0.0) { if (gd_500 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_500 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("aud" + li_0, gi_576, gi_580, gi_416); gi_580 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_508 < 0.0) { if (gd_508 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_508 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("nzd" + li_0, gi_588, gi_592, gi_416); gi_592 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_516 < 0.0) { if (gd_516 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_516 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("cad" + li_0, gi_600, gi_604, gi_416); gi_604 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_524 < 0.0) { if (gd_524 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_524 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("chf" + li_0, gi_612, gi_616, gi_416); gi_616 += gi_460; } for (li_0 = 1; li_0 < 11; li_0++) { if (gd_532 < 0.0) { if (gd_532 <= -li_0) gi_416 = colorCalc(-li_0); else gi_416 = colorCalc2(li_0); } else { if (gd_532 >= li_0) gi_416 = colorCalc(li_0); else gi_416 = colorCalc2(li_0); } DrawObject("jpy" + li_0, gi_624, gi_628, gi_416); gi_628 += gi_460; } } if (Display_suggestions) { li_4 = 90; li_8 = 15; if (Use.Reverse.Suggestions) li_4 += 15; if (Trade_EURUSD) { if (gd_484 >= 0.0 && gd_476 < 0.0) { if (gd_484 >= Trade_Level && gd_476 <= (-Trade_Level)) { DrawSuggest("EURUSD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURUSD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_476 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_476 >= Trade_Level) { DrawSuggest("EURUSD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURUSD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_GBPUSD) { if (gd_492 >= 0.0 && gd_476 < 0.0) { if (gd_492 >= Trade_Level && gd_476 <= (-Trade_Level)) { DrawSuggest("GBPUSD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPUSD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_492 < 0.0 && gd_476 >= 0.0) { if (gd_492 <= (-Trade_Level) && gd_476 >= Trade_Level) { DrawSuggest("GBPUSD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPUSD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_USDCHF) { if (gd_476 >= 0.0 && gd_524 < 0.0) { if (gd_476 >= Trade_Level && gd_524 <= (-Trade_Level)) { DrawSuggest("USDCHF", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("USDCHF", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_476 < 0.0 && gd_524 >= 0.0) { if (gd_476 <= (-Trade_Level) && gd_524 >= Trade_Level) { DrawSuggest("USDCHF", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("USDCHF", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_USDJPY) { if (gd_476 >= 0.0 && gd_532 < 0.0) { if (gd_476 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("USDJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("USDJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_476 < 0.0 && gd_532 >= 0.0) { if (gd_476 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("USDJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("USDJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_AUDUSD) { if (gd_500 >= 0.0 && gd_476 < 0.0) { if (gd_500 >= Trade_Level && gd_476 <= (-Trade_Level)) { DrawSuggest("AUDUSD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDUSD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_500 < 0.0 && gd_476 >= 0.0) { if (gd_500 <= (-Trade_Level) && gd_476 >= Trade_Level) { DrawSuggest("AUDUSD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDUSD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_USDCAD) { if (gd_476 >= 0.0 && gd_516 < 0.0) { if (gd_476 >= Trade_Level && gd_516 <= (-Trade_Level)) { DrawSuggest("USDCAD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("USDCAD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_476 < 0.0 && gd_516 >= 0.0) { if (gd_476 <= (-Trade_Level) && gd_516 >= Trade_Level) { DrawSuggest("USDCAD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("USDCAD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_EURAUD) { if (gd_484 >= 0.0 && gd_500 < 0.0) { if (gd_484 >= Trade_Level && gd_500 <= (-Trade_Level)) { DrawSuggest("EURAUD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURAUD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_500 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_500 >= Trade_Level) { DrawSuggest("EURAUD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURAUD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_EURCHF) { if (gd_484 >= 0.0 && gd_524 < 0.0) { if (gd_484 >= Trade_Level && gd_524 <= (-Trade_Level)) { DrawSuggest("EURCHF", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURCHF", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_524 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_524 >= Trade_Level) { DrawSuggest("EURCHF", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURCHF", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_EURGBP) { if (gd_484 >= 0.0 && gd_492 < 0.0) { if (gd_484 >= Trade_Level && gd_492 <= (-Trade_Level)) { DrawSuggest("EURGBP", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURGBP", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_492 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_492 >= Trade_Level) { DrawSuggest("EURGBP", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURGBP", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_EURJPY) { if (gd_484 >= 0.0 && gd_532 < 0.0) { if (gd_484 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("EURJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_532 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("EURJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_GBPCHF) { if (gd_492 >= 0.0 && gd_524 < 0.0) { if (gd_492 >= Trade_Level && gd_524 <= (-Trade_Level)) { DrawSuggest("GBPCHF", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPCHF", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_492 < 0.0 && gd_524 >= 0.0) { if (gd_492 <= (-Trade_Level) && gd_524 >= Trade_Level) { DrawSuggest("GBPCHF", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPCHF", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_GBPJPY) { if (gd_492 >= 0.0 && gd_532 < 0.0) { if (gd_492 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("GBPJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_492 < 0.0 && gd_532 >= 0.0) { if (gd_492 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("GBPJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_AUDCAD) { if (gd_500 >= 0.0 && gd_516 < 0.0) { if (gd_500 >= Trade_Level && gd_516 <= (-Trade_Level)) { DrawSuggest("AUDCAD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDCAD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_500 < 0.0 && gd_516 >= 0.0) { if (gd_500 <= (-Trade_Level) && gd_516 >= Trade_Level) { DrawSuggest("AUDCAD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDCAD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_AUDCHF) { if (gd_500 >= 0.0 && gd_524 < 0.0) { if (gd_500 >= Trade_Level && gd_524 <= (-Trade_Level)) { DrawSuggest("AUDCHF", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDCHF", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_500 < 0.0 && gd_524 >= 0.0) { if (gd_500 <= (-Trade_Level) && gd_524 >= Trade_Level) { DrawSuggest("AUDCHF", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDCHF", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_AUDJPY) { if (gd_500 >= 0.0 && gd_532 < 0.0) { if (gd_500 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("AUDJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_500 < 0.0 && gd_532 >= 0.0) { if (gd_500 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("AUDJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_AUDNZD) { if (gd_500 >= 0.0 && gd_508 < 0.0) { if (gd_500 >= Trade_Level && gd_508 <= (-Trade_Level)) { DrawSuggest("AUDNZD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDNZD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_500 < 0.0 && gd_508 >= 0.0) { if (gd_500 <= (-Trade_Level) && gd_508 >= Trade_Level) { DrawSuggest("AUDNZD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("AUDNZD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_CADCHF) { if (gd_516 >= 0.0 && gd_524 < 0.0) { if (gd_516 >= Trade_Level && gd_524 <= (-Trade_Level)) { DrawSuggest("CADCHF", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("CADCHF", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_516 < 0.0 && gd_524 >= 0.0) { if (gd_516 <= (-Trade_Level) && gd_524 >= Trade_Level) { DrawSuggest("CADCHF", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("CADCHF", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_CADJPY) { if (gd_516 >= 0.0 && gd_532 < 0.0) { if (gd_516 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("CADJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("CADJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_516 < 0.0 && gd_532 >= 0.0) { if (gd_516 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("CADJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("CADJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_CHFJPY) { if (gd_524 >= 0.0 && gd_532 < 0.0) { if (gd_524 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("CHFJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("CHFJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_524 < 0.0 && gd_532 >= 0.0) { if (gd_524 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("CHFJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("CHFJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_EURCAD) { if (gd_484 >= 0.0 && gd_516 < 0.0) { if (gd_484 >= Trade_Level && gd_516 <= (-Trade_Level)) { DrawSuggest("EURCAD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURCAD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_516 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_516 >= Trade_Level) { DrawSuggest("EURCAD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURCAD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_EURNZD) { if (gd_484 >= 0.0 && gd_508 < 0.0) { if (gd_484 >= Trade_Level && gd_508 <= (-Trade_Level)) { DrawSuggest("EURNZD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURNZD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_484 < 0.0 && gd_508 >= 0.0) { if (gd_484 <= (-Trade_Level) && gd_508 >= Trade_Level) { DrawSuggest("EURNZD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("EURNZD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_NZDCAD) { if (gd_508 >= 0.0 && gd_516 < 0.0) { if (gd_508 >= Trade_Level && gd_516 <= (-Trade_Level)) { DrawSuggest("NZDCAD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDCAD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_508 < 0.0 && gd_516 >= 0.0) { if (gd_508 <= (-Trade_Level) && gd_516 >= Trade_Level) { DrawSuggest("NZDCAD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDCAD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_NZDCHF) { if (gd_508 >= 0.0 && gd_524 < 0.0) { if (gd_508 >= Trade_Level && gd_524 <= (-Trade_Level)) { DrawSuggest("NZDCHF", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDCHF", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_508 < 0.0 && gd_524 >= 0.0) { if (gd_508 <= (-Trade_Level) && gd_524 >= Trade_Level) { DrawSuggest("NZDCHF", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDCHF", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_NZDJPY) { if (gd_508 >= 0.0 && gd_532 < 0.0) { if (gd_508 >= Trade_Level && gd_532 <= (-Trade_Level)) { DrawSuggest("NZDJPY", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDJPY", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_508 < 0.0 && gd_532 >= 0.0) { if (gd_508 <= (-Trade_Level) && gd_532 >= Trade_Level) { DrawSuggest("NZDJPY", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDJPY", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_NZDUSD) { if (gd_508 >= 0.0 && gd_476 < 0.0) { if (gd_508 >= Trade_Level && gd_476 <= (-Trade_Level)) { DrawSuggest("NZDUSD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDUSD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_508 < 0.0 && gd_476 >= 0.0) { if (gd_508 <= (-Trade_Level) && gd_476 >= Trade_Level) { DrawSuggest("NZDUSD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("NZDUSD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_GBPAUD) { if (gd_492 >= 0.0 && gd_500 < 0.0) { if (gd_492 >= Trade_Level && gd_500 <= (-Trade_Level)) { DrawSuggest("GBPAUD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPAUD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_492 < 0.0 && gd_500 >= 0.0) { if (gd_492 <= (-Trade_Level) && gd_500 >= Trade_Level) { DrawSuggest("GBPAUD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPAUD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_GBPCAD) { if (gd_492 >= 0.0 && gd_516 < 0.0) { if (gd_492 >= Trade_Level && gd_516 <= (-Trade_Level)) { DrawSuggest("GBPCAD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPCAD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_492 < 0.0 && gd_516 >= 0.0) { if (gd_492 <= (-Trade_Level) && gd_516 >= Trade_Level) { DrawSuggest("GBPCAD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPCAD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (Trade_GBPNZD) { if (gd_492 >= 0.0 && gd_508 < 0.0) { if (gd_492 >= Trade_Level && gd_508 <= (-Trade_Level)) { DrawSuggest("GBPNZD", "Buy", li_4, BUY_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPNZD", "Buy", li_4, BUY_color, -1); li_4 += li_8; } } } if (gd_492 < 0.0 && gd_508 >= 0.0) { if (gd_492 <= (-Trade_Level) && gd_508 >= Trade_Level) { DrawSuggest("GBPNZD", "Sell", li_4, SELL_color, 1); li_4 += li_8; } else { if (Use.Reverse.Suggestions) { DrawSuggest("GBPNZD", "Sell", li_4, SELL_color, -1); li_4 += li_8; } } } } if (li_4 == 90) { DrawSuggest("NO", "No Pair To trade", li_4, Pair_color, 0); li_4 += li_8; } DrawLast(li_4); DrawTimer(); } return (0); } double usdCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; return (ld_ret_4); } double eurCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double gbpCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double audCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double nzdCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) / ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double cadCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double chfCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0) / (ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double jpyCalc(int ai_0) { if (Use.Current) ai_0--; double ld_ret_4 = ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) - 1.0; ld_ret_4 += ma("EURUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("EURUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("GBPUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("GBPUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("AUDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("AUDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("NZDUSD" + gs_428, Slow, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("NZDUSD" + gs_428, Fast, MA_Method, Price, ai_0) * ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCAD" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; ld_ret_4 += ma("USDJPY" + gs_428, Slow, MA_Method, Price, ai_0) / ma("USDCHF" + gs_428, Slow, MA_Method, Price, ai_0) / (ma("USDJPY" + gs_428, Fast, MA_Method, Price, ai_0) / ma("USDCHF" + gs_428, Fast, MA_Method, Price, ai_0)) - 1.0; return (ld_ret_4); } double ma(string a_symbol_0, int ai_8, int a_ma_method_12, int a_applied_price_16, int ai_20) { double ld_ret_24 = 0; int li_32 = 1; int li_36 = 0; if (Timeframe == 0) Timeframe = Period(); int l_timeframe_40 = Timeframe; if (!Use.Bar.instead.of.MA) { switch (Timeframe) { case PERIOD_M1: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 5; case PERIOD_M5: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 3; case PERIOD_M15: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 2; case PERIOD_M30: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 2; case PERIOD_H1: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 4; case PERIOD_H4: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 6; case PERIOD_D1: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 4; case PERIOD_W1: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); li_32 += 4; case PERIOD_MN1: ld_ret_24 += iMA(a_symbol_0, l_timeframe_40, ai_8 * li_32, li_36, a_ma_method_12, a_applied_price_16, ai_20); } } else { if (ai_8 == Fast) { switch (Timeframe) { case PERIOD_M1: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_M5: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_M15: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_M30: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_H1: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_H4: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_D1: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_W1: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_MN1: ld_ret_24 += iClose(a_symbol_0, l_timeframe_40, ai_20); } } else { switch (Timeframe) { case PERIOD_M1: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_M5: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_M15: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_M30: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_H1: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_H4: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_D1: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_W1: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); case PERIOD_MN1: ld_ret_24 += iOpen(a_symbol_0, l_timeframe_40, ai_20); } } } return (ld_ret_24); } int Lookup(double ad_0) { int li_ret_12; int lia_8[19] = {-90, -80, -70, -60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90}; if (ad_0 <= lia_8[0]) li_ret_12 = -10; else { if (ad_0 < lia_8[1]) li_ret_12 = -9; else { if (ad_0 < lia_8[2]) li_ret_12 = -8; else { if (ad_0 < lia_8[3]) li_ret_12 = -7; else { if (ad_0 < lia_8[4]) li_ret_12 = -6; else { if (ad_0 < lia_8[5]) li_ret_12 = -5; else { if (ad_0 < lia_8[6]) li_ret_12 = -4; else { if (ad_0 < lia_8[7]) li_ret_12 = -3; else { if (ad_0 < lia_8[8]) li_ret_12 = -2; else { if (ad_0 < lia_8[9]) li_ret_12 = -1; else { if (ad_0 < lia_8[10]) li_ret_12 = 1; else { if (ad_0 < lia_8[11]) li_ret_12 = 2; else { if (ad_0 < lia_8[12]) li_ret_12 = 3; else { if (ad_0 < lia_8[13]) li_ret_12 = 4; else { if (ad_0 < lia_8[14]) li_ret_12 = 5; else { if (ad_0 < lia_8[15]) li_ret_12 = 6; else { if (ad_0 < lia_8[16]) li_ret_12 = 7; else { if (ad_0 < lia_8[17]) li_ret_12 = 8; else { if (ad_0 < lia_8[18]) li_ret_12 = 9; else li_ret_12 = 10; } } } } } } } } } } } } } } } } } } return (li_ret_12); } int colorCalc(double ad_0) { int l_color_12; int lia_8[19] = {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; if (ad_0 <= lia_8[0]) l_color_12 = Sell_color9; else { if (ad_0 == lia_8[1]) l_color_12 = Sell_color8; else { if (ad_0 == lia_8[2]) l_color_12 = Sell_color7; else { if (ad_0 == lia_8[3]) l_color_12 = Sell_color6; else { if (ad_0 == lia_8[4]) l_color_12 = Sell_color5; else { if (ad_0 == lia_8[5]) l_color_12 = Sell_color4; else { if (ad_0 == lia_8[6]) l_color_12 = Sell_color3; else { if (ad_0 == lia_8[7]) l_color_12 = Sell_color2; else { if (ad_0 == lia_8[8]) l_color_12 = Sell_color1; else { if (ad_0 == lia_8[9]) l_color_12 = Buy_color1; else { if (ad_0 == lia_8[10]) l_color_12 = Buy_color1; else { if (ad_0 == lia_8[11]) l_color_12 = Buy_color2; else { if (ad_0 == lia_8[12]) l_color_12 = Buy_color3; else { if (ad_0 == lia_8[13]) l_color_12 = Buy_color4; else { if (ad_0 == lia_8[14]) l_color_12 = Buy_color5; else { if (ad_0 == lia_8[15]) l_color_12 = Buy_color6; else { if (ad_0 == lia_8[16]) l_color_12 = Buy_color7; else { if (ad_0 == lia_8[17]) l_color_12 = Buy_color8; else { if (ad_0 == lia_8[18]) l_color_12 = Buy_color9; else l_color_12 = Buy_color10; } } } } } } } } } } } } } } } } } } return (l_color_12); } int colorCalc2(double ad_0) { int li_ret_12; int lia_8[19] = {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; if (ad_0 <= lia_8[0]) li_ret_12 = -1; else { if (ad_0 == lia_8[1]) li_ret_12 = -1; else { if (ad_0 == lia_8[2]) li_ret_12 = -1; else { if (ad_0 == lia_8[3]) li_ret_12 = -1; else { if (ad_0 == lia_8[4]) li_ret_12 = -1; else { if (ad_0 == lia_8[5]) li_ret_12 = -1; else { if (ad_0 == lia_8[6]) li_ret_12 = -1; else { if (ad_0 == lia_8[7]) li_ret_12 = -1; else { if (ad_0 == lia_8[8]) li_ret_12 = -1; else { if (ad_0 == lia_8[9]) li_ret_12 = -1; else { if (ad_0 == lia_8[10]) li_ret_12 = 11184810; else { if (ad_0 == lia_8[11]) li_ret_12 = 10526880; else { if (ad_0 == lia_8[12]) li_ret_12 = 9868950; else { if (ad_0 == lia_8[13]) li_ret_12 = 9211020; else { if (ad_0 == lia_8[14]) li_ret_12 = 8553090; else { if (ad_0 == lia_8[15]) li_ret_12 = 7895160; else { if (ad_0 == lia_8[16]) li_ret_12 = 7237230; else { if (ad_0 == lia_8[17]) li_ret_12 = 6579300; else { if (ad_0 == lia_8[18]) li_ret_12 = 5921370; else li_ret_12 = 5263440; } } } } } } } } } } } } } } } } } } return (li_ret_12); } void DrawObject(string a_name_0, int ai_8, int ai_12, color a_color_16) { a_name_0 = Indicator_ID_Number + "CCFdiff" + a_name_0; if (ObjectFind(a_name_0) == -1) ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0); ObjectSet(a_name_0, OBJPROP_CORNER, 2); ObjectSet(a_name_0, OBJPROP_XDISTANCE, ai_8 + X_offset_histo); ObjectSet(a_name_0, OBJPROP_YDISTANCE, ai_12 + Y_offset_histo); ObjectSet(a_name_0, OBJPROP_BACK, TRUE); ObjectSet(a_name_0, OBJPROP_COLOR, a_color_16); ObjectSetText(a_name_0, "_", 30, "Arial", a_color_16); } void DrawText(string a_text_0, int ai_8) { string l_name_12 = Indicator_ID_Number + "CCFdiff" + a_text_0; if (ObjectFind(l_name_12) == -1) ObjectCreate(l_name_12, OBJ_LABEL, 0, 0, 0); ObjectSet(l_name_12, OBJPROP_CORNER, 2); ObjectSet(l_name_12, OBJPROP_XDISTANCE, ai_8 + X_offset_histo); ObjectSet(l_name_12, OBJPROP_YDISTANCE, Y_offset_histo + 59); ObjectSet(l_name_12, OBJPROP_COLOR, Currency_color); ObjectSetText(l_name_12, a_text_0, 7, "Arial", Currency_color); l_name_12 = Indicator_ID_Number + "CCFdiffcopy"; if (ObjectFind(l_name_12) == -1) ObjectCreate(l_name_12, OBJ_LABEL, 0, 0, 0); ObjectSet(l_name_12, OBJPROP_CORNER, 2); ObjectSet(l_name_12, OBJPROP_XDISTANCE, X_offset_histo + 10); ObjectSet(l_name_12, OBJPROP_YDISTANCE, Y_offset_histo + 5); ObjectSet(l_name_12, OBJPROP_COLOR, C'0x50,0x50,0x50'); ObjectSetText(l_name_12, "CCFp-Diff - FerruFx - http://www.ervent.net", 7, "Arial", C'0x50,0x50,0x50'); l_name_12 = Indicator_ID_Number + "CCFdiffline5"; if (ObjectFind(l_name_12) == -1) ObjectCreate(l_name_12, OBJ_LABEL, 0, 0, 0); ObjectSet(l_name_12, OBJPROP_CORNER, 2); ObjectSet(l_name_12, OBJPROP_XDISTANCE, X_offset_histo + 7); ObjectSet(l_name_12, OBJPROP_YDISTANCE, Y_offset_histo + 53); ObjectSet(l_name_12, OBJPROP_COLOR, C'0x50,0x50,0x50'); ObjectSetText(l_name_12, "------------------------------------------------", 9, "Arial", C'0x50,0x50,0x50'); l_name_12 = Indicator_ID_Number + "CCFdiffline6"; if (ObjectFind(l_name_12) == -1) ObjectCreate(l_name_12, OBJ_LABEL, 0, 0, 0); ObjectSet(l_name_12, OBJPROP_CORNER, 2); ObjectSet(l_name_12, OBJPROP_XDISTANCE, X_offset_histo + 7); ObjectSet(l_name_12, OBJPROP_YDISTANCE, Y_offset_histo + 65); ObjectSet(l_name_12, OBJPROP_COLOR, C'0x50,0x50,0x50'); ObjectSetText(l_name_12, "------------------------------------------------", 9, "Arial", C'0x50,0x50,0x50'); l_name_12 = Indicator_ID_Number + "CCFdiffline7"; if (ObjectFind(l_name_12) == -1) ObjectCreate(l_name_12, OBJ_LABEL, 0, 0, 0); ObjectSet(l_name_12, OBJPROP_CORNER, 2); ObjectSet(l_name_12, OBJPROP_XDISTANCE, X_offset_histo + 7); ObjectSet(l_name_12, OBJPROP_YDISTANCE, Y_offset_histo + 11); ObjectSet(l_name_12, OBJPROP_COLOR, C'0x50,0x50,0x50'); ObjectSetText(l_name_12, "------------------------------------------------", 9, "Arial", C'0x50,0x50,0x50'); l_name_12 = Indicator_ID_Number + "CCFdifftf"; if (ObjectFind(l_name_12) == -1) ObjectCreate(l_name_12, OBJ_LABEL, 0, 0, 0); string ls_20 = ""; if (Use.Current) ls_20 = " current"; ObjectSet(l_name_12, OBJPROP_CORNER, 2); ObjectSet(l_name_12, OBJPROP_XDISTANCE, X_offset_histo + 7); ObjectSet(l_name_12, OBJPROP_YDISTANCE, Y_offset_histo + 70); ObjectSet(l_name_12, OBJPROP_COLOR, C'0x50,0x50,0x50'); ObjectSetText(l_name_12, gs_444 + ls_20, 9, "Arial Black", C'0x50,0x50,0x50'); } void DrawNum(string as_0, double ad_8, int ai_16) { int li_20; ad_8 = NormalizeDouble(MathAbs(ad_8), 0); if (ad_8 == 0.0 || ad_8 == 2.0 || ad_8 == 3.0 || ad_8 == 4.0 || ad_8 == 5.0 || ad_8 == 6.0 || ad_8 == 7.0 || ad_8 == 8.0 || ad_8 == 9.0) li_20 = 6; else { if (ad_8 == 10.0) li_20 = -1; else if (ad_8 == 1.0) li_20 = 5; } string l_name_24 = Indicator_ID_Number + "CCFdiff_" + as_0; if (ObjectFind(l_name_24) == -1) ObjectCreate(l_name_24, OBJ_LABEL, 0, 0, 0); ObjectSet(l_name_24, OBJPROP_CORNER, 2); ObjectSet(l_name_24, OBJPROP_XDISTANCE, ai_16 + li_20 + X_offset_histo); ObjectSet(l_name_24, OBJPROP_YDISTANCE, Y_offset_histo + 38); ObjectSet(l_name_24, OBJPROP_COLOR, Currency_color); ObjectSetText(l_name_24, DoubleToStr(ad_8, 0), 12, "Arial Black", Values_color); } void DrawSuggest(string a_text_0, string as_8, int ai_16, color a_color_20, int ai_24) { if (!Use.Reverse.Suggestions) gs_452 = " "; else gs_452 = ""; g_name_436 = Indicator_ID_Number + "CCF_diffline1"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 20); ObjectSetText(g_name_436, "--------------------------------------", 9, "Arial", DarkGray); g_name_436 = Indicator_ID_Number + "CCF_diffsug"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); if (Timeframe == 0) Timeframe = Period(); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 30); ObjectSetText(g_name_436, "Suggestion for " + Timeframe + "mins TF", 8, "Verdana", DarkGray); g_name_436 = Indicator_ID_Number + "CCF_difflev"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 45); ObjectSetText(g_name_436, "Trade Level set to " + Trade_Level, 8, "Verdana", DarkGray); g_name_436 = Indicator_ID_Number + "CCF_diffline2"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 52); ObjectSetText(g_name_436, "--------------------------------------", 9, "Arial", DarkGray); g_name_436 = Indicator_ID_Number + "CCF_diffline3"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 74); ObjectSetText(g_name_436, "--------------------------------------", 9, "Arial", DarkGray); if (Use.Reverse.Suggestions) { g_name_436 = Indicator_ID_Number + "CCF_diff" + a_text_0 + "revlog"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 6); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 85); ObjectSetText(g_name_436, "a", 8, "Wingdings", Reverse_color); g_name_436 = Indicator_ID_Number + "CCF_diff" + a_text_0 + "revinf"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 20); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 84); ObjectSetText(g_name_436, "--> pairs to be reversed", 8, "Verdana", Reverse_color); g_name_436 = Indicator_ID_Number + "CCF_diffline8"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 90); ObjectSetText(g_name_436, "--------------------------------------", 9, "Arial", DarkGray); } if (a_text_0 != "NO") { g_name_436 = Indicator_ID_Number + "CCF_diff" + a_text_0; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 25); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_16 + Y_offset_comments); ObjectSetText(g_name_436, a_text_0, 8, "Verdana", Pair_color); g_name_436 = Indicator_ID_Number + "CCF_diff" + a_text_0 + "suggest"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_16 + Y_offset_comments); ObjectSetText(g_name_436, " ¤ " + gs_452 + "--->" + gs_452 + " " + as_8, 8, "Verdana", a_color_20); if (Use.Reverse.Suggestions && ai_24 == -1) { g_name_436 = Indicator_ID_Number + "CCF_diff" + a_text_0 + "rev"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 145); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_16 + 1 + Y_offset_comments); ObjectSetText(g_name_436, "a", 7, "Wingdings", Reverse_color); } } else { g_name_436 = Indicator_ID_Number + "CCF_diff" + a_text_0; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_16 - 3 + Y_offset_comments); ObjectSetText(g_name_436, " ¤ " + as_8 + " ¤", 9, "Verdana", a_color_20); } } void DrawLast(int ai_0) { g_name_436 = Indicator_ID_Number + "CCF_diffline4"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_0 - 8 + Y_offset_comments); ObjectSetText(g_name_436, "--------------------------------------", 9, "Arial", DarkGray); string l_text_4 = "Refreshing process done !"; if (gi_472 == FALSE) l_text_4 = "Pairs refresh, Waiting ......"; g_name_436 = Indicator_ID_Number + "CCF_diffrefresh"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 7); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_0 + 2 + Y_offset_comments); ObjectSetText(g_name_436, l_text_4, 8, "Verdana", CadetBlue); g_name_436 = Indicator_ID_Number + "CCF_diffline9"; if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, ai_0 + 8 + Y_offset_comments); ObjectSetText(g_name_436, "--------------------------------------", 9, "Arial", DarkGray); } void DrawTimer() { g_name_436 = Indicator_ID_Number + "CCF_difftimer"; if (Timeframe == 0) Timeframe = Period(); int li_0 = iTime(Symbol(), Timeframe, 0) + 60 * Timeframe - TimeCurrent(); if (ObjectFind(g_name_436) == -1) ObjectCreate(g_name_436, OBJ_LABEL, 0, 0, 0); ObjectSet(g_name_436, OBJPROP_CORNER, 0); ObjectSet(g_name_436, OBJPROP_XDISTANCE, X_offset_comments + 5); ObjectSet(g_name_436, OBJPROP_YDISTANCE, Y_offset_comments + 62); ObjectSetText(g_name_436, " Bar end: " + TimeToStr(li_0, TIME_SECONDS), 12, "Eras Bold ITC", Timer_color); if (SignalAlert || SendAlertEmail && g_datetime_420 != iTime(Symbol(), Timeframe, 0)) { if (SignalAlert) Alert("CCFp-Diff - New ", Timeframe, "mins bar started - ", TimeToStr(TimeCurrent(), TIME_SECONDS)); if (SendAlertEmail) SendMail("CCFp-Diff Alert", "CCFp-Diff - New " + Timeframe + "mins bar started - " + TimeToStr(TimeCurrent(), TIME_SECONDS) + " (server time)"); g_datetime_420 = iTime(Symbol(), Timeframe, 0); } } void cleanup() { string l_name_0; int l_objs_total_8 = ObjectsTotal(); for (int li_12 = l_objs_total_8 - 1; li_12 >= 0; li_12--) { l_name_0 = ObjectName(li_12); if (StringFind(l_name_0, Indicator_ID_Number + "CCFdiff") == 0) ObjectDelete(l_name_0); if (StringFind(l_name_0, Indicator_ID_Number + "CCF_diff") == 0) ObjectDelete(l_name_0); } }