#property copyright "Michael E Wilkinson DDDS Copyright © 2009" #property link "mewddsltd@msn.com" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Teal #property indicator_color2 SlateBlue #property indicator_color3 MediumVioletRed extern bool IsMiniAcct = TRUE; extern string MiniAcctText = "m"; extern string VolatilityNote1 = "---Choose a timeframe---"; extern string VolatilityNote2 = "0 = 1 Min"; extern string VolatilityNote3 = "1 = 5 Min // 2 = 15 Min"; extern string VolatilityNote4 = "3 = 30 Min // 4 = 1 Hour"; extern string VolatilityNote5 = "5 = 4 Hour // 6 = Daily "; extern string VolatilityNote6 = "7 = Weekly // 8 = Montly"; extern int volTimeFrame = 7; extern string Pair01 = "AUDCAD"; extern string Pair02 = "AUDCHF"; extern string Pair03 = "AUDJPY"; extern string Pair04 = "AUDNZD"; extern string Pair05 = "AUDUSD"; extern string Pair06 = "CADJPY"; extern string Pair07 = "CHFJPY"; extern string Pair08 = "EURAUD"; extern string Pair09 = "EURCAD"; extern string Pair10 = "EURCHF"; extern string Pair11 = "EURGBP"; extern string Pair12 = "EURJPY"; extern string Pair13 = "EURUSD"; extern string Pair14 = "GBPAUD"; extern string Pair15 = "GBPCHF"; extern string Pair16 = "GBPJPY"; extern string Pair17 = "GBPUSD"; extern string Pair18 = "NZDCHF"; extern string Pair19 = "NZDJPY"; extern string Pair20 = "NZDUSD"; extern string Pair21 = "USDCAD"; extern string Pair22 = "USDCHF"; extern string Pair23 = "USDJPY"; extern string Pair24 = "USDSGD"; extern string WindowName = "Volatility"; extern int VolatilityPeriods = 3; extern int VolatilityLevel1 = 100; extern int VolatilityLevel2 = 200; extern int VolatilityLevel3 = 300; extern int VolatilityLevel4 = 400; extern int VolatilityLevel5 = 500; extern color clrHeaderTxt = White; extern color clrText1 = LightPink; extern color clrText2 = FireBrick; extern color clrText3 = Green; extern color clrText4 = Green; extern color clrText5 = Navy; extern color clrText6 = LightSkyBlue; extern bool DisplayFrame = FALSE; extern color clrFrame = Navy; extern color clrCell1 = HotPink; extern color clrCell2 = LightPink; extern color clrCell3 = LightGreen; extern color clrCell4 = MediumSeaGreen; extern color clrCell5 = LightSkyBlue; extern color clrCell6 = DeepSkyBlue; int g_timeframe_424 = 0; int gi_428 = 0; double gd_432; double gd_440; double gd_448; double gd_456; double gd_464; double gd_472; double gd_480; double gd_488; double gd_496; double gd_504; double gd_512; double gd_520; double gd_528; double gd_536; double gd_544; double gd_552; double gd_560; double gd_568; double gd_576; double gd_584; double gd_592; double gd_600; double gd_608; double gd_616; string gs_624; string gs_632; string gs_640; string gs_648; string gs_656; string gs_664; string gs_672; string gs_680; string gs_688; string gs_696; string gs_704; string gs_712; string gs_720; string gs_728; string gs_736; string gs_744; string gs_752; string gs_760; string gs_768; string gs_776; string gs_784; string gs_792; string gs_800; string gs_808; string gs_816; string gs_824; string gs_832; string gs_840; string gs_848; string gs_856; string gs_864; string gs_872; string gs_880; string gs_888; string gs_896; string gs_904; string gs_912; string gs_920; string gs_928; string gs_936; string gs_944; string gs_952; string gs_960; string gs_968; string gs_976; string gs_984; string gs_992; string gs_1000; datetime g_time_1008; int AuthorizedDate() { bool li_ret_0; string ls_4 = "2009.12.31"; int l_str2time_12 = StrToTime(ls_4); if (TimeCurrent() <= l_str2time_12) li_ret_0 = TRUE; else li_ret_0 = FALSE; return (li_ret_0); } int AuthorizedAccount(int ai_0) { bool li_ret_4 = FALSE; if (ai_0 == 6025474 || ai_0 == 6048211 || ai_0 == 5569156 || ai_0 == 5649174 || ai_0 == 6046489 || ai_0 == 2368036 || ai_0 == 5661503 || ai_0 == 11201 || ai_0 == 1139824 || ai_0 == 5672146 || ai_0 == 5665482 || ai_0 == 1612010 || ai_0 == 1612012 || ai_0 == 1612015 || ai_0 == 1613288 || ai_0 == 1613289 || ai_0 == 1613290 || ai_0 == 1613292 || ai_0 == 1613293 || ai_0 == 1614331 || ai_0 == 5635503) li_ret_4 = TRUE; else li_ret_4 = FALSE; return (li_ret_4); } int AuthorizedKey(int ai_0) { bool li_ret_4 = FALSE; int li_8 = 1 * StrToInteger(StringSubstr(DoubleToStr(ai_0, 0), 0, 2)); int li_12 = 3 * StrToInteger(StringSubstr(DoubleToStr(ai_0, 0), 2, 2)); int li_16 = 5 * StrToInteger(StringSubstr(DoubleToStr(ai_0, 0), 4, 2)); int li_20 = StrToInteger(StringSubstr(DoubleToStr(ai_0, 0), 6, 2)) * 2; int li_24 = StrToInteger(StringSubstr(DoubleToStr(ai_0, 0), 8, 2)) << 2; int li_28 = li_8 + li_12 + li_16 + li_20 + li_24; if (li_28 == 57 || li_28 == 61 || li_28 == 67 || li_28 == 76 || li_28 == 200 || li_28 == 204 || li_28 == 206 || li_28 == 211 || li_28 == 213 || li_28 == 225 || li_28 == 254 || li_28 == 296 || li_28 == 311 || li_28 == 349 || li_28 == 354 || li_28 == 378 || li_28 == 417 || li_28 == 456 || li_28 == 495 || li_28 == 546) li_ret_4 = TRUE; else li_ret_4 = FALSE; return (li_ret_4); } int init() { switch (volTimeFrame) { case 0: g_timeframe_424 = 1; break; case 1: g_timeframe_424 = 5; break; case 2: g_timeframe_424 = 15; break; case 3: g_timeframe_424 = 30; break; case 4: g_timeframe_424 = 60; break; case 5: g_timeframe_424 = 240; break; case 6: g_timeframe_424 = 1440; break; case 7: g_timeframe_424 = 10080; break; case 8: g_timeframe_424 = 43200; } string ls_4 = ""; if (IsMiniAcct) ls_4 = MiniAcctText; Pair01 = Pair01 + ls_4; Pair02 = Pair02 + ls_4; Pair03 = Pair03 + ls_4; Pair04 = Pair04 + ls_4; Pair05 = Pair05 + ls_4; Pair06 = Pair06 + ls_4; Pair07 = Pair07 + ls_4; Pair08 = Pair08 + ls_4; Pair09 = Pair09 + ls_4; Pair10 = Pair10 + ls_4; Pair11 = Pair11 + ls_4; Pair12 = Pair12 + ls_4; Pair13 = Pair13 + ls_4; Pair14 = Pair14 + ls_4; Pair15 = Pair15 + ls_4; Pair16 = Pair16 + ls_4; Pair17 = Pair17 + ls_4; Pair18 = Pair18 + ls_4; Pair19 = Pair19 + ls_4; Pair20 = Pair20 + ls_4; Pair21 = Pair21 + ls_4; Pair22 = Pair22 + ls_4; Pair23 = Pair23 + ls_4; Pair24 = Pair24 + ls_4; gs_624 = "lbl" + Pair01; gs_632 = "lbl" + Pair02; gs_640 = "lbl" + Pair03; gs_648 = "lbl" + Pair04; gs_656 = "lbl" + Pair05; gs_664 = "lbl" + Pair06; gs_672 = "lbl" + Pair07; gs_680 = "lbl" + Pair08; gs_688 = "lbl" + Pair09; gs_696 = "lbl" + Pair10; gs_704 = "lbl" + Pair11; gs_712 = "lbl" + Pair12; gs_720 = "lbl" + Pair13; gs_728 = "lbl" + Pair14; gs_736 = "lbl" + Pair15; gs_744 = "lbl" + Pair16; gs_752 = "lbl" + Pair17; gs_760 = "lbl" + Pair18; gs_768 = "lbl" + Pair19; gs_776 = "lbl" + Pair20; gs_784 = "lbl" + Pair21; gs_792 = "lbl" + Pair22; gs_800 = "lbl" + Pair23; gs_808 = "lbl" + Pair24; gs_816 = "amt" + Pair01; gs_824 = "amt" + Pair02; gs_832 = "amt" + Pair03; gs_840 = "amt" + Pair04; gs_848 = "amt" + Pair05; gs_856 = "amt" + Pair06; gs_864 = "amt" + Pair07; gs_872 = "amt" + Pair08; gs_880 = "amt" + Pair09; gs_888 = "amt" + Pair10; gs_896 = "amt" + Pair11; gs_904 = "amt" + Pair12; gs_912 = "amt" + Pair13; gs_920 = "amt" + Pair14; gs_928 = "amt" + Pair15; gs_936 = "amt" + Pair16; gs_944 = "amt" + Pair17; gs_952 = "amt" + Pair18; gs_960 = "amt" + Pair19; gs_968 = "amt" + Pair20; gs_976 = "amt" + Pair21; gs_984 = "amt" + Pair22; gs_992 = "amt" + Pair23; gs_1000 = "amt" + Pair24; IndicatorShortName(WindowName); return (0); } int deinit() { DeleteObjects(); Comment(""); return (0); } int start() { int l_period_0; int li_100; int li_104; int li_108; int li_112; int li_116; int li_120; int li_124; int li_128; int li_132; int li_136; int li_140; int li_144; int li_148; int li_152; int li_156; int li_160; int li_164; int li_168; int li_172; int li_176; int li_180; int li_184; int li_188; int li_192; int li_196; int li_200; int li_204; int li_208; string ls_212; string ls_224; if (AuthorizedDate() && AuthorizedAccount(AccountNumber()) && AuthorizedKey(AccountNumber())) { if (NewBar()) { l_period_0 = VolatilityPeriods; gd_432 = iATR(Pair01, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair01); gd_440 = iATR(Pair02, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair02); gd_448 = iATR(Pair03, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair03); gd_456 = iATR(Pair04, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair04); gd_464 = iATR(Pair05, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair05); gd_472 = iATR(Pair06, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair06); gd_480 = iATR(Pair07, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair07); gd_488 = iATR(Pair08, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair08); gd_496 = iATR(Pair09, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair09); gd_504 = iATR(Pair10, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair10); gd_512 = iATR(Pair11, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair11); gd_520 = iATR(Pair12, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair12); gd_528 = iATR(Pair13, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair13); gd_536 = iATR(Pair14, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair14); gd_544 = iATR(Pair15, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair15); gd_552 = iATR(Pair16, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair16); gd_560 = iATR(Pair17, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair17); gd_568 = iATR(Pair18, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair18); gd_576 = iATR(Pair19, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair19); gd_584 = iATR(Pair20, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair20); gd_592 = iATR(Pair21, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair21); gd_600 = iATR(Pair22, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair22); gd_608 = iATR(Pair23, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair23); gd_616 = iATR(Pair24, g_timeframe_424, l_period_0, gi_428) / getPoint(Pair24); li_100 = 105; li_104 = 14; li_108 = 42; li_112 = 152; li_116 = 262; li_120 = 372; li_124 = 482; li_128 = 592; li_132 = 26; li_136 = 42; li_140 = 58; li_144 = 74; if (DisplayFrame) { DeleteObjects(); DrawCell(WindowFind(WindowName), "Header1.1", li_108 - 2, 5, 662, 16, clrFrame); DrawCell(WindowFind(WindowName), "Footer1.1", li_108 - 1, 94, 613, 1, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.1", li_108 - 2, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.2", li_112 - 2, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.3", li_116 - 2, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.4", li_120 - 2, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.5", li_124 - 2, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.6", li_128 - 2, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "Vertical1.7", li_128 + 109, 11, 1, 78, clrFrame); DrawCell(WindowFind(WindowName), "row1.1", li_108, li_132, li_100, li_104, GetCellColor(gd_432)); DrawCell(WindowFind(WindowName), "row2.1", li_108, li_136, li_100, li_104, GetCellColor(gd_440)); DrawCell(WindowFind(WindowName), "row3.1", li_108, li_140, li_100, li_104, GetCellColor(gd_448)); DrawCell(WindowFind(WindowName), "row4.1", li_108, li_144, li_100, li_104, GetCellColor(gd_456)); DrawCell(WindowFind(WindowName), "row1.2", li_112, li_132, li_100, li_104, GetCellColor(gd_464)); DrawCell(WindowFind(WindowName), "row2.2", li_112, li_136, li_100, li_104, GetCellColor(gd_472)); DrawCell(WindowFind(WindowName), "row3.2", li_112, li_140, li_100, li_104, GetCellColor(gd_480)); DrawCell(WindowFind(WindowName), "row4.2", li_112, li_144, li_100, li_104, GetCellColor(gd_488)); DrawCell(WindowFind(WindowName), "row1.3", li_116, li_132, li_100, li_104, GetCellColor(gd_496)); DrawCell(WindowFind(WindowName), "row2.3", li_116, li_136, li_100, li_104, GetCellColor(gd_504)); DrawCell(WindowFind(WindowName), "row3.3", li_116, li_140, li_100, li_104, GetCellColor(gd_512)); DrawCell(WindowFind(WindowName), "row4.3", li_116, li_144, li_100, li_104, GetCellColor(gd_520)); DrawCell(WindowFind(WindowName), "row1.4", li_120, li_132, li_100, li_104, GetCellColor(gd_528)); DrawCell(WindowFind(WindowName), "row2.4", li_120, li_136, li_100, li_104, GetCellColor(gd_536)); DrawCell(WindowFind(WindowName), "row3.4", li_120, li_140, li_100, li_104, GetCellColor(gd_544)); DrawCell(WindowFind(WindowName), "row4.4", li_120, li_144, li_100, li_104, GetCellColor(gd_552)); DrawCell(WindowFind(WindowName), "row1.5", li_124, li_132, li_100, li_104, GetCellColor(gd_560)); DrawCell(WindowFind(WindowName), "row2.5", li_124, li_136, li_100, li_104, GetCellColor(gd_568)); DrawCell(WindowFind(WindowName), "row3.5", li_124, li_140, li_100, li_104, GetCellColor(gd_576)); DrawCell(WindowFind(WindowName), "row4.5", li_124, li_144, li_100, li_104, GetCellColor(gd_584)); DrawCell(WindowFind(WindowName), "row1.6", li_128, li_132, li_100, li_104, GetCellColor(gd_592)); DrawCell(WindowFind(WindowName), "row2.6", li_128, li_136, li_100, li_104, GetCellColor(gd_600)); DrawCell(WindowFind(WindowName), "row3.6", li_128, li_140, li_100, li_104, GetCellColor(gd_608)); DrawCell(WindowFind(WindowName), "row4.6", li_128, li_144, li_100, li_104, GetCellColor(gd_616)); } li_148 = 30; li_152 = 46; li_156 = 62; li_160 = 78; li_164 = 50; li_168 = 160; li_172 = 270; li_176 = 380; li_180 = 490; li_184 = 600; li_188 = 120; li_192 = 230; li_196 = 340; li_200 = 450; li_204 = 560; li_208 = 670; ls_212 = ""; switch (g_timeframe_424) { case PERIOD_M1: ls_212 = "1 Minute"; break; case PERIOD_M5: ls_212 = "5 Minute"; break; case PERIOD_M15: ls_212 = "15 Minute"; break; case PERIOD_M30: ls_212 = "30 Minute"; break; case PERIOD_H1: ls_212 = "1 Hour"; break; case PERIOD_H4: ls_212 = "4 Hour"; break; case PERIOD_D1: ls_212 = "Daily"; break; case PERIOD_W1: ls_212 = "Weekly"; break; case PERIOD_MN1: ls_212 = "Monthly"; } ls_224 = "Average Trading Range ( Time Frame: " + ls_212 + " // Periods: " + VolatilityPeriods + " )"; setPair("lblATR", ls_224, WindowName, 53, 11, clrHeaderTxt); setPair(gs_624, Pair01, WindowName, li_164, li_148, GetTextColor(gd_432)); setPair(gs_632, Pair02, WindowName, li_164, li_152, GetTextColor(gd_440)); setPair(gs_640, Pair03, WindowName, li_164, li_156, GetTextColor(gd_448)); setPair(gs_648, Pair04, WindowName, li_164, li_160, GetTextColor(gd_456)); setPair(gs_656, Pair05, WindowName, li_168, li_148, GetTextColor(gd_464)); setPair(gs_664, Pair06, WindowName, li_168, li_152, GetTextColor(gd_472)); setPair(gs_672, Pair07, WindowName, li_168, li_156, GetTextColor(gd_480)); setPair(gs_680, Pair08, WindowName, li_168, li_160, GetTextColor(gd_488)); setPair(gs_688, Pair09, WindowName, li_172, li_148, GetTextColor(gd_496)); setPair(gs_696, Pair10, WindowName, li_172, li_152, GetTextColor(gd_504)); setPair(gs_704, Pair11, WindowName, li_172, li_156, GetTextColor(gd_512)); setPair(gs_712, Pair12, WindowName, li_172, li_160, GetTextColor(gd_520)); setPair(gs_720, Pair13, WindowName, li_176, li_148, GetTextColor(gd_528)); setPair(gs_728, Pair14, WindowName, li_176, li_152, GetTextColor(gd_536)); setPair(gs_736, Pair15, WindowName, li_176, li_156, GetTextColor(gd_544)); setPair(gs_744, Pair16, WindowName, li_176, li_160, GetTextColor(gd_552)); setPair(gs_752, Pair17, WindowName, li_180, li_148, GetTextColor(gd_560)); setPair(gs_760, Pair18, WindowName, li_180, li_152, GetTextColor(gd_568)); setPair(gs_768, Pair19, WindowName, li_180, li_156, GetTextColor(gd_576)); setPair(gs_776, Pair20, WindowName, li_180, li_160, GetTextColor(gd_584)); setPair(gs_784, Pair21, WindowName, li_184, li_148, GetTextColor(gd_592)); setPair(gs_792, Pair22, WindowName, li_184, li_152, GetTextColor(gd_600)); setPair(gs_800, Pair23, WindowName, li_184, li_156, GetTextColor(gd_608)); setPair(gs_808, Pair24, WindowName, li_184, li_160, GetTextColor(gd_616)); setVolatility(gs_816, gd_432, WindowName, li_188, li_148, GetTextColor(gd_432)); setVolatility(gs_824, gd_440, WindowName, li_188, li_152, GetTextColor(gd_440)); setVolatility(gs_832, gd_448, WindowName, li_188, li_156, GetTextColor(gd_448)); setVolatility(gs_840, gd_456, WindowName, li_188, li_160, GetTextColor(gd_456)); setVolatility(gs_848, gd_464, WindowName, li_192, li_148, GetTextColor(gd_464)); setVolatility(gs_856, gd_472, WindowName, li_192, li_152, GetTextColor(gd_472)); setVolatility(gs_864, gd_480, WindowName, li_192, li_156, GetTextColor(gd_480)); setVolatility(gs_872, gd_488, WindowName, li_192, li_160, GetTextColor(gd_488)); setVolatility(gs_880, gd_496, WindowName, li_196, li_148, GetTextColor(gd_496)); setVolatility(gs_888, gd_504, WindowName, li_196, li_152, GetTextColor(gd_504)); setVolatility(gs_896, gd_512, WindowName, li_196, li_156, GetTextColor(gd_512)); setVolatility(gs_904, gd_520, WindowName, li_196, li_160, GetTextColor(gd_520)); setVolatility(gs_912, gd_528, WindowName, li_200, li_148, GetTextColor(gd_528)); setVolatility(gs_920, gd_536, WindowName, li_200, li_152, GetTextColor(gd_536)); setVolatility(gs_928, gd_544, WindowName, li_200, li_156, GetTextColor(gd_544)); setVolatility(gs_936, gd_552, WindowName, li_200, li_160, GetTextColor(gd_552)); setVolatility(gs_944, gd_560, WindowName, li_204, li_148, GetTextColor(gd_560)); setVolatility(gs_952, gd_568, WindowName, li_204, li_152, GetTextColor(gd_568)); setVolatility(gs_960, gd_576, WindowName, li_204, li_156, GetTextColor(gd_576)); setVolatility(gs_968, gd_584, WindowName, li_204, li_160, GetTextColor(gd_584)); setVolatility(gs_976, gd_592, WindowName, li_208, li_148, GetTextColor(gd_592)); setVolatility(gs_984, gd_600, WindowName, li_208, li_152, GetTextColor(gd_600)); setVolatility(gs_992, gd_608, WindowName, li_208, li_156, GetTextColor(gd_608)); setVolatility(gs_1000, gd_616, WindowName, li_208, li_160, GetTextColor(gd_616)); return (0); } } else { Alert("Use of this indicator is not authorized on this account!"); return (-1); } return (0); } void setPair(string a_name_0, string a_text_8, string as_16, int a_x_24, int a_y_28, color a_color_32) { ObjectDelete(a_name_0); ObjectCreate(a_name_0, OBJ_LABEL, WindowFind(as_16), Time[0], 0); ObjectSetText(a_name_0, a_text_8, 10, "Verdana", a_color_32); ObjectSet(a_name_0, OBJPROP_CORNER, 0); ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_24); ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_28); } void setVolatility(string a_name_0, double ad_8, string as_16, int a_x_24, int a_y_28, color a_color_32) { ObjectDelete(a_name_0); ObjectCreate(a_name_0, OBJ_LABEL, WindowFind(as_16), Time[0], 0); ObjectSetText(a_name_0, DoubleToStr(ad_8, 0), 10, "Verdana", a_color_32); ObjectSet(a_name_0, OBJPROP_CORNER, 0); ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_24); ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_28); } double getPoint(string as_0) { double ld_ret_8 = 0; if (StringSubstr(as_0, 3, 3) == "JPY") ld_ret_8 = 0.01; else ld_ret_8 = 0.0001; return (ld_ret_8); } void DrawCell(int a_window_0, string a_name_4, double a_x_12, double a_y_20, double ad_28, double ad_36, color a_color_44) { double l_fontsize_48; double l_fontsize_56; double ld_64; int li_72; ObjectDelete(a_name_4); if (ad_28 > ad_36) { li_72 = MathCeil(ad_28 / ad_36); l_fontsize_48 = MathRound(100.0 * ad_36 / 77.0); l_fontsize_56 = MathRound(100.0 * ad_28 / 77.0); ld_64 = l_fontsize_56 / li_72 - 2.0 * (l_fontsize_48 / (9 - ad_36 / 100.0)); for (int l_count_76 = 0; l_count_76 < li_72; l_count_76++) { ObjectCreate(a_name_4 + l_count_76, OBJ_LABEL, a_window_0, 0, 0); ObjectSetText(a_name_4 + l_count_76, CharToStr(110), l_fontsize_48, "Wingdings", a_color_44); ObjectSet(a_name_4 + l_count_76, OBJPROP_XDISTANCE, a_x_12 + ld_64 * l_count_76); ObjectSet(a_name_4 + l_count_76, OBJPROP_YDISTANCE, a_y_20); ObjectSet(a_name_4 + l_count_76, OBJPROP_BACK, TRUE); } } else { li_72 = MathCeil(ad_36 / ad_28); l_fontsize_48 = MathRound(100.0 * ad_36 / 77.0); l_fontsize_56 = MathRound(100.0 * ad_28 / 77.0); ld_64 = l_fontsize_48 / li_72 - 2.0 * (l_fontsize_56 / (9 - ad_28 / 100.0)); for (l_count_76 = 0; l_count_76 < li_72; l_count_76++) { ObjectCreate(a_name_4 + l_count_76, OBJ_LABEL, a_window_0, 0, 0); ObjectSetText(a_name_4 + l_count_76, CharToStr(110), l_fontsize_56, "Wingdings", a_color_44); ObjectSet(a_name_4 + l_count_76, OBJPROP_XDISTANCE, a_x_12); ObjectSet(a_name_4 + l_count_76, OBJPROP_YDISTANCE, a_y_20 + ld_64 * l_count_76); ObjectSet(a_name_4 + l_count_76, OBJPROP_BACK, TRUE); } } } int GetCellColor(double ad_0) { int l_color_8 = CLR_NONE; if (ad_0 < VolatilityLevel1) l_color_8 = clrCell1; if (ad_0 >= VolatilityLevel1 && ad_0 < VolatilityLevel2) l_color_8 = clrCell2; if (ad_0 >= VolatilityLevel2 && ad_0 < VolatilityLevel3) l_color_8 = clrCell3; if (ad_0 >= VolatilityLevel3 && ad_0 < VolatilityLevel4) l_color_8 = clrCell4; if (ad_0 >= VolatilityLevel4 && ad_0 < VolatilityLevel5) l_color_8 = clrCell5; if (ad_0 >= VolatilityLevel5) l_color_8 = clrCell6; return (l_color_8); } int GetTextColor(double ad_0) { int l_color_8 = CLR_NONE; if (ad_0 < VolatilityLevel1) l_color_8 = clrText1; if (ad_0 >= VolatilityLevel1 && ad_0 < VolatilityLevel2) l_color_8 = clrText2; if (ad_0 >= VolatilityLevel2 && ad_0 < VolatilityLevel3) l_color_8 = clrText3; if (ad_0 >= VolatilityLevel3 && ad_0 < VolatilityLevel4) l_color_8 = clrText4; if (ad_0 >= VolatilityLevel4 && ad_0 < VolatilityLevel5) l_color_8 = clrText5; if (ad_0 >= VolatilityLevel5) l_color_8 = clrText6; return (l_color_8); } void DeleteObjects() { ObjectDelete("Header1.1"); ObjectDelete("Footer1.1"); ObjectDelete("Vertical1.1"); ObjectDelete("Vertical1.2"); ObjectDelete("Vertical1.3"); ObjectDelete("Vertical1.4"); ObjectDelete("Vertical1.5"); ObjectDelete("Vertical1.6"); ObjectDelete("Vertical1.7"); ObjectDelete("row1.1"); ObjectDelete("row2.1"); ObjectDelete("row3.1"); ObjectDelete("row4.1"); ObjectDelete("row1.2"); ObjectDelete("row2.2"); ObjectDelete("row3.2"); ObjectDelete("row4.2"); ObjectDelete("row1.3"); ObjectDelete("row2.3"); ObjectDelete("row3.3"); ObjectDelete("row4.3"); ObjectDelete("row1.4"); ObjectDelete("row2.4"); ObjectDelete("row3.4"); ObjectDelete("row4.4"); ObjectDelete("row1.5"); ObjectDelete("row2.5"); ObjectDelete("row3.5"); ObjectDelete("row4.5"); ObjectDelete("row1.6"); ObjectDelete("row2.6"); ObjectDelete("row3.6"); ObjectDelete("row4.6"); } bool NewBar() { datetime l_time_0 = Time[0]; if (g_time_1008 != l_time_0) { g_time_1008 = l_time_0; return (TRUE); } return (FALSE); }