- /*
- Generated by EX4-TO-MQ4 decompiler FREEWARE V4.0.451.1 [-]
- Website: http://www.metaquotes.net
- E-mail : support@metaquotes.net
- */
- #property indicator_chart_window
- #property indicator_buffers 2
- #property indicator_color1 Black
- #property indicator_color2 Black
- extern int forced_tf = 0;
- extern bool use_narrow_bands = TRUE;
- extern bool kill_retouch = TRUE;
- extern color TopColor = DimGray;
- extern color BotColor = DimGray;
- double g_ibuf_96[];
- double g_ibuf_100[];
- double gd_104 = 13.0;
- int gi_112 = 8;
- int gi_116 = 5;
- int g_datetime_120;
- int g_time_124;
- double gd_136;
- string g_symbol_144;
- double gd_152;
- int g_digits_160;
- int g_timeframe_164;
- string gs_168;
- double gd_176;
- double gd_184;
- int g_datetime_192 = 0;
- // E37F0136AA3FFAF149B351F6A4C948E9
- int init() {
- SetIndexBuffer(1, g_ibuf_96);
- SetIndexEmptyValue(1, 0.0);
- SetIndexStyle(1, DRAW_NONE);
- SetIndexBuffer(0, g_ibuf_100);
- SetIndexEmptyValue(0, 0.0);
- SetIndexStyle(0, DRAW_NONE);
- if (forced_tf= 0) g_timeframe_164 =forced_tf;
- else g_timeframe_164 = Period();
- gd_152 = Point;
- g_digits_160 = Digits;
- if (g_digits_160 == 3 || g_digits_160 == 5) gd_152 = 10.0 * gd_152;
- gs_168 = "" + g_timeframe_164;
- return (0);
- }
- // 52D46093050F38C27267BCE42543EF60
- int deinit() {
- f0_2(gs_168);
- Comment("");
- return (0);
- }
- // EA2B2676C28C0DB26D39331A336C6B92
- int start() {
- if (f0_0() == 1) {
- f0_3(g_ibuf_96, g_ibuf_100, gd_104, gi_112, gi_116);
- f0_4();
- f0_1();
- }
- return (0);
- }
- // 2D03C2D5A7EC65EF4619E0582C272EC2
- void f0_1() {
- string name_4;
- f0_2(gs_168);
- for (int li_0 = 0; li_0 < iBars(g_symbol_144, g_timeframe_164); li_0++) {
- if (g_ibuf_100[li_0] > 0.0) {
- g_datetime_120 = iTime(g_symbol_144, g_timeframe_164, li_0);
- g_time_124 = Time[0];
- if (use.narrow.bands) gd_136 = MathMax(iClose(g_symbol_144, g_timeframe_164, li_0), iOpen(g_symbol_144, g_timeframe_164, li_0));
- else gd_136 = MathMin(iClose(g_symbol_144, g_timeframe_164, li_0), iOpen(g_symbol_144, g_timeframe_164, li_0));
- gd_136 = MathMax(gd_136, MathMax(iLow(g_symbol_144, g_timeframe_164, li_0 - 1), iLow(g_symbol_144, g_timeframe_164, li_0 + 1)));
- name_4 = gs_168 + "UPFILL" + g_timeframe_164 + li_0;
- ObjectCreate(name_4, OBJ_RECTANGLE, 0, 0, 0, 0, 0);
- ObjectSet(name_4, OBJPROP_TIME1, g_datetime_120);
- ObjectSet(name_4, OBJPROP_PRICE1, g_ibuf_100[li_0]);
- ObjectSet(name_4, OBJPROP_TIME2, g_time_124);
- ObjectSet(name_4, OBJPROP_PRICE2, gd_136);
- ObjectSet(name_4, OBJPROP_COLOR, TopColor);
- }
- if (g_ibuf_96[li_0] > 0.0) {
- g_datetime_120 = iTime(g_symbol_144, g_timeframe_164, li_0);
- g_time_124 = Time[0];
- if (use.narrow.bands) gd_136 = MathMin(iClose(g_symbol_144, g_timeframe_164, li_0), iOpen(g_symbol_144, g_timeframe_164, li_0));
- else gd_136 = MathMax(iClose(g_symbol_144, g_timeframe_164, li_0), iOpen(g_symbol_144, g_timeframe_164, li_0));
- if (li_0 > 0) gd_136 = MathMin(gd_136, MathMin(iHigh(g_symbol_144, g_timeframe_164, li_0 + 1), iHigh(g_symbol_144, g_timeframe_164, li_0 - 1)));
- name_4 = gs_168 + "DNFILL" + g_timeframe_164 + li_0;
- ObjectCreate(name_4, OBJ_RECTANGLE, 0, 0, 0, 0, 0);
- ObjectSet(name_4, OBJPROP_TIME1, g_datetime_120);
- ObjectSet(name_4, OBJPROP_PRICE1, gd_136);
- ObjectSet(name_4, OBJPROP_TIME2, g_time_124);
- ObjectSet(name_4, OBJPROP_PRICE2, g_ibuf_96[li_0]);
- ObjectSet(name_4, OBJPROP_COLOR, BotColor);
- }
- }
- }
- // 09470FB701C11F8B07320EA009403A60
- int f0_0() {
- if (iTime(g_symbol_144, g_timeframe_164, 0) != g_datetime_192) {
- g_datetime_192 = iTime(g_symbol_144, g_timeframe_164, 0);
- return (1);
- }
- return (0);
- }
- // 3B6B0C1FF666CC49A2DCBDC950C224CE
- void f0_2(string as_0) {
- string name_16;
- int str_len_8 = StringLen(as_0);
- int li_12 = 0;
- while (li_12 < ObjectsTotal()) {
- name_16 = ObjectName(li_12);
- if (StringSubstr(name_16, 0, str_len_8) != as_0) {
- li_12++;
- continue;
- }
- ObjectDelete(name_16);
- }
- }
- // 3CA4C22A90227AC4A7684A00FAEE2BA5
- int f0_3(double &ada_0[], double &ada_4[], int ai_8, int ai_12, int ai_16) {
- double ld_36;
- double ld_44;
- double ld_52;
- double ld_60;
- double ld_68;
- double ld_76;
- int li_84 = iBars(g_symbol_144, g_timeframe_164) - ai_8;
- for (int li_20 = li_84; li_20 >= 0; li_20--) {
- ld_36 = iLow(g_symbol_144, g_timeframe_164, iLowest(g_symbol_144, g_timeframe_164, MODE_LOW, ai_8, li_20));
- if (ld_36 == ld_76) ld_36 = 0.0;
- else {
- ld_76 = ld_36;
- if (iLow(g_symbol_144, g_timeframe_164, li_20) - ld_36 > ai_12 * Point) ld_36 = 0.0;
- else {
- for (int li_24 = 1; li_24 <= ai_16; li_24++) {
- ld_44 = ada_0[li_20 + li_24];
- if (ld_44 != 0.0 && ld_44 > ld_36) ada_0[li_20 + li_24] = 0.0;
- }
- }
- }
- ada_0[li_20] = ld_36;
- ld_36 = iHigh(g_symbol_144, g_timeframe_164, iHighest(g_symbol_144, g_timeframe_164, MODE_HIGH, ai_8, li_20));
- if (ld_36 == ld_68) ld_36 = 0.0;
- else {
- ld_68 = ld_36;
- if (ld_36 - iHigh(g_symbol_144, g_timeframe_164, li_20) > ai_12 * Point) ld_36 = 0.0;
- else {
- for (li_24 = 1; li_24 <= ai_16; li_24++) {
- ld_44 = ada_4[li_20 + li_24];
- if (ld_44 != 0.0 && ld_44 < ld_36) ada_4[li_20 + li_24] = 0.0;
- }
- }
- }
- ada_4[li_20] = ld_36;
- }
- ld_68 = -1;
- int li_28 = -1;
- ld_76 = -1;
- int li_32 = -1;
- for (li_20 = li_84; li_20 >= 0; li_20--) {
- ld_52 = ada_0[li_20];
- ld_60 = ada_4[li_20];
- if (ld_52 == 0.0 && ld_60 == 0.0) continue;
- if (ld_60 != 0.0) {
- if (ld_68 > 0.0) {
- if (ld_68 < ld_60) ada_4[li_28] = 0;
- else ada_4[li_20] = 0;
- }
- if (ld_68 < ld_60 || ld_68 < 0.0) {
- ld_68 = ld_60;
- li_28 = li_20;
- }
- ld_76 = -1;
- }
- if (ld_52 != 0.0) {
- if (ld_76 > 0.0) {
- if (ld_76 > ld_52) ada_0[li_32] = 0;
- else ada_0[li_20] = 0;
- }
- if (ld_52 < ld_76 || ld_76 < 0.0) {
- ld_76 = ld_52;
- li_32 = li_20;
- }
- ld_68 = -1;
- }
- }
- for (li_20 = iBars(g_symbol_144, g_timeframe_164) - 1; li_20 >= 0; li_20--) {
- if (li_20 >= li_84) ada_0[li_20] = 0.0;
- else {
- ld_44 = ada_4[li_20];
- if (ld_44 != 0.0) ada_4[li_20] = ld_44;
- }
- }
- return (0);
- }
- // 9F1BFF196B458CFDFF8DE3A24AAFEA26
- void f0_4() {
- gd_176 = 0;
- int li_0 = 0;
- gd_184 = 0;
- int li_4 = 0;
- double ld_8 = 0;
- double ld_16 = 0;
- double ld_24 = 0;
- double ld_32 = 0;
- double ld_40 = 0;
- double ld_48 = 0;
- for (int li_56 = 0; li_56 < iBars(g_symbol_144, g_timeframe_164); li_56++) {
- if (g_ibuf_96[li_56] > 0.0) {
- gd_176 = g_ibuf_96[li_56];
- ld_16 = g_ibuf_96[li_56];
- ld_24 = ld_16;
- break;
- }
- }
- for (li_56 = 0; li_56 < iBars(g_symbol_144, g_timeframe_164); li_56++) {
- if (g_ibuf_100[li_56] > 0.0) {
- gd_184 = g_ibuf_100[li_56];
- ld_8 = g_ibuf_100[li_56];
- ld_32 = ld_8;
- break;
- }
- }
- for (li_56 = 0; li_56 < iBars(g_symbol_144, g_timeframe_164); li_56++) {
- if (g_ibuf_100[li_56] >= ld_32) {
- ld_32 = g_ibuf_100[li_56];
- li_4 = li_56;
- } else g_ibuf_100[li_56] = 0.0;
- if (g_ibuf_100[li_56] <= gd_184 && g_ibuf_96[li_56] > 0.0) g_ibuf_100[li_56] = 0.0;
- if (g_ibuf_96[li_56] <= ld_24 && g_ibuf_96[li_56] > 0.0) {
- ld_24 = g_ibuf_96[li_56];
- li_0 = li_56;
- } else g_ibuf_96[li_56] = 0.0;
- if (g_ibuf_96[li_56] > gd_176) g_ibuf_96[li_56] = 0.0;
- }
- if (kill.retouch) {
- if (use.narrow.bands) {
- ld_40 = MathMax(iOpen(g_symbol_144, g_timeframe_164, li_4), iClose(g_symbol_144, g_timeframe_164, li_4));
- ld_48 = MathMin(iOpen(g_symbol_144, g_timeframe_164, li_0), iClose(g_symbol_144, g_timeframe_164, li_0));
- } else {
- ld_40 = MathMin(iOpen(g_symbol_144, g_timeframe_164, li_4), iClose(g_symbol_144, g_timeframe_164, li_4));
- ld_48 = MathMax(iOpen(g_symbol_144, g_timeframe_164, li_0), iClose(g_symbol_144, g_timeframe_164, li_0));
- }
- for (li_56 = MathMax(li_0, li_4); li_56 >= 0; li_56--) {
- if (g_ibuf_100[li_56] > ld_40 && g_ibuf_100[li_56] != ld_32) g_ibuf_100[li_56] = 0.0;
- else {
- if (use.narrow.bands && g_ibuf_100[li_56] > 0.0) {
- ld_40 = MathMax(iOpen(g_symbol_144, g_timeframe_164, li_56), iClose(g_symbol_144, g_timeframe_164, li_56));
- ld_32 = g_ibuf_100[li_56];
- } else {
- if (g_ibuf_100[li_56] > 0.0) {
- ld_40 = MathMin(iOpen(g_symbol_144, g_timeframe_164, li_56), iClose(g_symbol_144, g_timeframe_164, li_56));
- ld_32 = g_ibuf_100[li_56];
- }
- }
- }
- if (g_ibuf_96[li_56] <= ld_48 && g_ibuf_96[li_56] > 0.0 && g_ibuf_96[li_56] != ld_24) g_ibuf_96[li_56] = 0.0;
- else {
- if (use.narrow.bands && g_ibuf_96[li_56] > 0.0) {
- ld_48 = MathMin(iOpen(g_symbol_144, g_timeframe_164, li_56), iClose(g_symbol_144, g_timeframe_164, li_56));
- ld_24 = g_ibuf_96[li_56];
- } else {
- if (g_ibuf_96[li_56] > 0.0) {
- ld_48 = MathMax(iOpen(g_symbol_144, g_timeframe_164, li_56), iClose(g_symbol_144, g_timeframe_164, li_56));
- ld_24 = g_ibuf_96[li_56];
- }
- }
- }
- }
- }
- }
复制代码
|