Facebook
From Noname, 9 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 82
  1. //+------------------------------------------------------------------+
  2. //|                                             DXTrade C4 Nitro.mq4 |
  3. //|                                Copyright © 2016 FXProSystems.com |
  4. //|                                         http://fxprosystems.com/ |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright © 2016 | FXProSystems.com"
  7. #property link      "http://fxprosystems.com"
  8.  
  9. #property indicator_chart_window
  10. #property indicator_buffers 2
  11. #property indicator_color1 DodgerBlue
  12. #property indicator_color2 Red
  13. #property indicator_width1 2
  14. #property indicator_width2 2
  15.  
  16. extern int Trix_Period = 2;
  17. extern int Period_MA = 10;
  18. double Gd_unused_84 = 0.0;
  19. string Gs_unused_92 = "0=SMA, 1=EMA, 2=SMMA, 3=LWMA";
  20. int Gi_unused_100 = 1;
  21. int Gi_unused_104 = 1;
  22. int Gi_unused_108 = 1;
  23. string Gs_unused_112 = "0=C,4=Median,5=Typical,6=Weighted";
  24. int Gi_unused_120 = 0;
  25. string Gs_unused_124 = "";
  26. int G_ma_method_132 = MODE_LWMA;
  27. int G_applied_price_136 = PRICE_WEIGHTED;
  28. extern int MOM_Period = 4;
  29. extern bool Alert_Signals = TRUE;
  30. extern bool Sound_On = TRUE;
  31. string Gs_unused_152 = "Change font colors automatically? True = Yes";
  32. extern bool Change_Colors = TRUE;
  33. extern string note2 = "Default Font Colors";
  34. extern color FontColor = DodgerBlue;
  35. extern color FontUp = Lime;
  36. extern color FontDown = Red;
  37. extern color BoxColor = C'0x2B,0x2B,0x2B';
  38. color G_color_188 = Black;
  39. color G_color_192 = Black;
  40. int Gi_unused_196 = 0;
  41. color G_color_200 = Black;
  42. color G_color_204 = Black;
  43. color G_color_208 = Black;
  44. string Gs_unused_212 = "Font Size";
  45. int G_fontsize_220 = 16;
  46. int G_fontsize_224 = 10;
  47. string G_fontname_228 = "Century Gothic";
  48. extern string note4 = "Distance of Indicator";
  49. extern int shiftx = 5;
  50. extern int shifty = 20;
  51. extern string note5 = "What corner?";
  52. extern string note6 = "Upper left=0; Upper right=1";
  53. extern string note7 = "Lower left=2; Lower right=3";
  54. extern int WhatCorner = 1;
  55. double G_bid_280;
  56. string G_text_288;
  57. string G_text_296;
  58. string G_text_304;
  59. string G_text_312;
  60. int Gi_320 = 15000;
  61. int G_period_324 = 0;
  62. double Gd_328 = 1000.0;
  63. double Gda_336[];
  64. double Gda_340[];
  65. double Gda_344[];
  66. double Gda_348[];
  67. double Gda_352[];
  68. double Gda_356[];
  69. double Gda_360[];
  70. double Gda_364[];
  71. double G_ibuf_368[];
  72. double G_ibuf_372[];
  73. bool Gi_376 = FALSE;
  74. bool Gi_380 = FALSE;
  75. int G_ma_method_384;
  76. int G_ma_method_388;
  77. int G_ma_method_392;
  78. int G_applied_price_396;
  79. double Gd_400;
  80. int G_datetime_408 = 0;
  81. int G_datetime_412 = 0;
  82. int G_datetime_416 = 0;
  83. int G_datetime_420 = 0;
  84.  
  85. int init() {
  86.    ArraySetAsSeries(Gda_336, TRUE);
  87.    ArraySetAsSeries(Gda_340, TRUE);
  88.    ArraySetAsSeries(Gda_364, TRUE);
  89.    ArraySetAsSeries(Gda_352, TRUE);
  90.    ArraySetAsSeries(Gda_356, TRUE);
  91.    ArraySetAsSeries(Gda_360, TRUE);
  92.    ArraySetAsSeries(Gda_344, TRUE);
  93.    ArraySetAsSeries(Gda_348, TRUE);
  94.    IndicatorDigits(Digits);
  95.    SetIndexBuffer(0, G_ibuf_368);
  96.    SetIndexStyle(0, DRAW_ARROW);
  97.    SetIndexArrow(0, SYMBOL_ARROWUP);
  98.    SetIndexLabel(0, "DXTrade C4 Nitro Up");
  99.    SetIndexBuffer(1, G_ibuf_372);
  100.    SetIndexStyle(1, DRAW_ARROW);
  101.    SetIndexArrow(1, SYMBOL_ARROWDOWN);
  102.    SetIndexLabel(1, "DXTrade C4 Nitro Down");
  103.    G_ma_method_384 = 1;
  104.    G_ma_method_388 = 1;
  105.    G_ma_method_392 = 1;
  106.    G_applied_price_396 = 0;
  107.    string Ls_0 = "DXTrade C4 Nitro Meter";
  108.    IndicatorShortName(Ls_0);
  109.    return (0);
  110. }
  111.  
  112. int deinit() {
  113.    ObjectDelete("dxtrade");
  114.    ObjectDelete("Box");
  115.    ObjectDelete("Box2");
  116.    ObjectDelete("Market_Price_Label");
  117.    ObjectDelete("Trix5mLabel");
  118.    ObjectDelete("Trix5m");
  119.    ObjectDelete("MaLabel");
  120.    ObjectDelete("Ma");
  121.    ObjectDelete("Pair");
  122.    ObjectDelete("Spread");
  123.    ObjectDelete("Trend");
  124.    ObjectDelete("TrendLabel");
  125.    ObjectDelete("TrendT5");
  126.    ObjectDelete("momLabel");
  127.    ObjectDelete("mom");
  128.    ObjectDelete("Trade");
  129.    ObjectDelete("Trade2");
  130.    return (0);
  131. }
  132.  
  133. int start() {
  134.    int shift_4;
  135.    int Li_8;
  136.    double point_12;
  137.    string Ls_20;
  138.    double Ld_32;
  139.    double Ld_40;
  140.    int Li_48;
  141.    int Li_52;
  142.    int Li_56;
  143.    double ima_60;
  144.    double iclose_68;
  145.    int Li_76;
  146.    int Li_80;
  147.    bool Li_84;
  148.    int Li_88;
  149.    int Li_92;
  150.    int Li_96;
  151.    int Li_100;
  152.    string Ls_104;
  153.    if (Change_Colors == TRUE) {
  154.       if (Bid > G_bid_280) G_color_200 = FontUp;
  155.       if (Bid < G_bid_280) G_color_200 = FontDown;
  156.       G_bid_280 = Bid;
  157.    }
  158.    int timeframe_0 = 0;
  159.    if (timeframe_0 != Period()) shift_4 = iBarShift(NULL, timeframe_0, iTime(NULL, 0, Li_8));
  160.    if (Point == 0.00001) point_12 = 0.0001;
  161.    else {
  162.       if (Point == 0.001) point_12 = 0.01;
  163.       else point_12 = Point;
  164.    }
  165.    if (Trix_Period == G_period_324) return (0);
  166.    ArrayResize(Gda_336, Bars);
  167.    ArrayResize(Gda_340, Bars);
  168.    ArrayResize(Gda_364, Bars);
  169.    ArrayResize(Gda_352, Bars);
  170.    ArrayResize(Gda_356, Bars);
  171.    ArrayResize(Gda_360, Bars);
  172.    ArrayResize(Gda_344, Bars);
  173.    ArrayResize(Gda_348, Bars);
  174.    int Li_28 = Gi_320;
  175.    if (Li_28 > Bars) Li_28 = Bars - 1;
  176.    for (Li_8 = 0; Li_8 < Li_28; Li_8++) Gda_336[Li_8] = iMA(Symbol(), Period(), Trix_Period, 0, G_ma_method_384, G_applied_price_396, Li_8);
  177.    for (Li_8 = 0; Li_8 < Li_28; Li_8++) Gda_340[Li_8] = iMAOnArray(Gda_336, 0, Trix_Period, 0, G_ma_method_388, Li_8);
  178.    for (Li_8 = 0; Li_8 < Li_28; Li_8++) Gda_364[Li_8] = iMAOnArray(Gda_340, 0, Trix_Period, 0, G_ma_method_392, Li_8);
  179.    for (Li_8 = 0; Li_8 < Li_28 - 1; Li_8++)
  180.       if (Gda_364[Li_8 + 1] != 0.0) Gda_336[Li_8] = Gd_328 * (Gda_364[Li_8] - (Gda_364[Li_8 + 1])) / (Gda_364[Li_8 + 1]);
  181.    for (Li_8 = 0; Li_8 < Li_28 - 1; Li_8++) Gda_340[Li_8] = iMAOnArray(Gda_336, 0, G_period_324, 0, MODE_EMA, Li_8);
  182.    for (Li_8 = 0; Li_8 < Li_28 - 1; Li_8++) {
  183.       Ld_32 = Gda_336[Li_8] - Gda_340[Li_8];
  184.       Gda_352[Li_8] = Ld_32;
  185.       if (Ld_32 >= 0.0) {
  186.          Gda_356[Li_8] = Ld_32;
  187.          Gda_360[Li_8] = EMPTY_VALUE;
  188.       } else {
  189.          Gda_356[Li_8] = EMPTY_VALUE;
  190.          Gda_360[Li_8] = Ld_32;
  191.       }
  192.    }
  193.    for (Li_8 = Li_28 - 1; Li_8 >= 0; Li_8--) {
  194.       Ld_40 = iATR(Symbol(), Period(), 10, Li_8) / 2.0;
  195.       Li_48 = 0;
  196.       G_ibuf_368[Li_8 + Li_48] = EMPTY_VALUE;
  197.       G_ibuf_372[Li_8 + Li_48] = EMPTY_VALUE;
  198.       Li_52 = Gda_356[Li_8 + Li_48] > 0.0 && Gda_356[Li_8 + Li_48] != EMPTY_VALUE && Gda_360[Li_8 + 1 + Li_48] < 0.0;
  199.       Li_56 = Gda_360[Li_8 + Li_48] < 0.0 && Gda_356[Li_8 + 1 + Li_48] != EMPTY_VALUE && Gda_356[Li_8 + 1 + Li_48] > 0.0;
  200.       if (Li_52 == 1) {
  201.          if (G_datetime_416 == 0) {
  202.             G_datetime_416 = iTime(Symbol(), Period(), Li_8 + Li_48);
  203.             G_datetime_420 = 0;
  204.          }
  205.       }
  206.       if (Li_56 == 1) {
  207.          if (G_datetime_420 == 0) {
  208.             G_datetime_416 = 0;
  209.             G_datetime_420 = iTime(Symbol(), Period(), Li_8 + Li_48);
  210.          }
  211.       }
  212.       ima_60 = iMA(Symbol(), Period(), Period_MA, 0, G_ma_method_132, G_applied_price_136, Li_8);
  213.       iclose_68 = iClose(Symbol(), Period(), Li_8 + Li_48);
  214.       Li_76 = iclose_68 > ima_60;
  215.       Li_80 = iclose_68 < ima_60;
  216.       if (Li_76 == 1) {
  217.          if (G_datetime_408 == 0) {
  218.             G_datetime_408 = iTime(Symbol(), Period(), Li_8 + Li_48);
  219.             G_datetime_412 = 0;
  220.          }
  221.       }
  222.       if (Li_80 == 1) {
  223.          if (G_datetime_412 == 0) {
  224.             G_datetime_408 = 0;
  225.             G_datetime_412 = iTime(Symbol(), Period(), Li_8 + Li_48);
  226.          }
  227.       }
  228.       Li_84 = FALSE;
  229.       if (Li_52 == 1 && Li_76 == 1) {
  230.          Li_88 = iTime(Symbol(), Period(), Li_8 + Li_48) - G_datetime_408;
  231.          Li_92 = iTime(Symbol(), Period(), Li_8 + Li_48) - G_datetime_416;
  232.          Li_84 = Li_88 >= Gd_400 && Li_92 >= Gd_400;
  233.       } else {
  234.          if (Li_56 == 1 && Li_80 == 1) {
  235.             Li_88 = iTime(Symbol(), Period(), Li_8 + Li_48) - G_datetime_412;
  236.             Li_92 = iTime(Symbol(), Period(), Li_8 + Li_48) - G_datetime_420;
  237.             Li_84 = Li_88 >= Gd_400 && Li_92 >= Gd_400;
  238.          }
  239.       }
  240.       Li_96 = Li_52 == 1 && Li_76 == 1 && Li_84 == TRUE;
  241.       Li_100 = Li_56 == 1 && Li_80 == 1 && Li_84 == TRUE;
  242.       if (Li_96 == 1) {
  243.          G_ibuf_368[Li_8 + Li_48] = Low[Li_8 + Li_48] - Ld_40;
  244.          G_ibuf_372[Li_8 + Li_48] = EMPTY_VALUE;
  245.       } else {
  246.          if (Li_100 == 1) {
  247.             G_ibuf_368[Li_8 + Li_48] = EMPTY_VALUE;
  248.             G_ibuf_372[Li_8 + Li_48] = High[Li_8 + Li_48] + Ld_40;
  249.          }
  250.       }
  251.       Ls_104 = Get_sPeriod(Period());
  252.       if (Li_8 == 0) {
  253.          if (Alert_Signals == TRUE) {
  254.             if (Li_96 && Gi_376 == FALSE) {
  255.                Ls_20 = "DXTrade C4/Nitro BUY:  " + Symbol() + "  @  " + DoubleToStr(Close[0], Digits) + "  (" + TimeToStr(TimeCurrent(), TIME_MINUTES) + ")";
  256.                if (Alert_Signals == TRUE) Alert&#40;Ls_20&#41;;
  257.                if (Sound_On == TRUE) PlaySound("analyzebuy.wav");
  258.                Gi_380 = FALSE;
  259.                Gi_376 = TRUE;
  260.                continue;
  261.             }
  262.             if (Li_100 && Gi_380 == FALSE) {
  263.                Ls_20 = "DXTrade C4/Nitro SELL:  " + Symbol() + "  @  " + DoubleToStr(Close[0], Digits) + "  (" + TimeToStr(TimeCurrent(), TIME_MINUTES) + ")";
  264.                if (Alert_Signals == TRUE) Alert&#40;Ls_20&#41;;
  265.                if (Sound_On == TRUE) PlaySound("analyzesell.wav");
  266.                Gi_380 = TRUE;
  267.                Gi_376 = FALSE;
  268.             }
  269.          }
  270.       }
  271.    }
  272.    string dbl2str_112 = DoubleToStr(Bid, Digits);
  273.    string Ls_120 = AccountCurrency();
  274.    string dbl2str_128 = DoubleToStr(NormalizeDouble((Ask - Bid) / point_12, 0), 0);
  275.    double Ld_136 = Gda_336[shift_4];
  276.    double Ld_144 = Gda_336[shift_4 + 1];
  277.    double Ld_152 = Gda_336[shift_4 + 2];
  278.    double ima_160 = iMA(NULL, timeframe_0, Period_MA, 0, G_ma_method_132, G_applied_price_136, shift_4);
  279.    double ima_168 = iMA(NULL, timeframe_0, Period_MA, 0, G_ma_method_132, G_applied_price_136, shift_4 + 1);
  280.    double imomentum_176 = iMomentum(NULL, timeframe_0, MOM_Period, PRICE_CLOSE, shift_4);
  281.    string text_184 = DoubleToStr(imomentum_176, 2);
  282.    string Ls_192 = CharToStr(77);
  283.    string Ls_200 = CharToStr(77);
  284.    string Ls_208 = CharToStr(73);
  285.    if (Ld_136 > 0.0) G_color_188 = FontUp;
  286.    if (Ld_136 < 0.0) G_color_188 = FontDown;
  287.    if (Ld_136 > 0.0) G_text_288 = CharToStr(77);
  288.    if (Ld_136 < 0.0) G_text_288 = CharToStr(77);
  289.    if (Ld_144 > 0.0 && Ld_152 < 0.0) G_color_208 = FontUp;
  290.    if (Ld_144 < 0.0 && Ld_152 > 0.0) G_color_208 = FontDown;
  291.    if (Ld_144 > 0.0 && Ld_152 < 0.0) G_text_304 = "Buy";
  292.    if (Ld_144 < 0.0 && Ld_152 > 0.0) G_text_304 = "Sell";
  293.    if (Ld_144 > 0.0 && Ld_152 > 0.0) G_color_208 = FontColor;
  294.    if (Ld_144 > 0.0 && Ld_152 > 0.0) G_text_304 = "Wait";
  295.    if (Ld_144 < 0.0 && Ld_152 < 0.0) G_color_208 = FontColor;
  296.    if (Ld_144 < 0.0 && Ld_152 < 0.0) G_text_304 = "Wait";
  297.    if (Ld_144 > 0.0 && Ld_152 < 0.0) G_text_312 = Ls_192;
  298.    if (Ld_144 < 0.0 && Ld_152 > 0.0) G_text_312 = Ls_200;
  299.    if (Ld_144 > 0.0 && Ld_152 > 0.0) G_text_312 = Ls_208;
  300.    if (Ld_144 < 0.0 && Ld_152 < 0.0) G_text_312 = Ls_208;
  301.    if (ima_160 > ima_168) G_color_192 = FontUp;
  302.    if (ima_160 < ima_168) G_color_192 = FontDown;
  303.    if (ima_160 == ima_168) G_color_192 = FontColor;
  304.    if (ima_160 > ima_168) G_text_296 = CharToStr(77);
  305.    if (ima_160 < ima_168) G_text_296 = CharToStr(77);
  306.    if (ima_160 == ima_168) G_text_296 = CharToStr(77);
  307.    if (imomentum_176 > 100.0) G_color_204 = FontUp;
  308.    if (imomentum_176 < 100.0) G_color_204 = FontDown;
  309.    if (imomentum_176 == 100.0) G_color_204 = FontColor;
  310.    if (imomentum_176 > 100.0) text_184 = CharToStr(77);
  311.    if (imomentum_176 < 100.0) text_184 = CharToStr(77);
  312.    if (imomentum_176 == 100.0) text_184 = CharToStr(77);
  313.    ObjectCreate("dxtrade", OBJ_LABEL, 0, 0, 0);
  314.    ObjectSet("dxtrade", OBJPROP_XDISTANCE, shiftx + 10);
  315.    ObjectSet("dxtrade", OBJPROP_YDISTANCE, shifty + 1);
  316.    ObjectSetText("dxtrade", "© DXTrade C4 Nitro", 7, G_fontname_228, DarkGoldenrod);
  317.    ObjectSet("dxtrade", OBJPROP_CORNER, WhatCorner);
  318.    ObjectSet("dxtrade", OBJPROP_BACK, FALSE);
  319.    ObjectCreate("Box", OBJ_LABEL, 0, 0, 0, 0, 0);
  320.    ObjectSetText("Box", "g", 80, "Webdings", BoxColor);
  321.    ObjectSet("Box", OBJPROP_CORNER, WhatCorner);
  322.    ObjectSet("Box", OBJPROP_XDISTANCE, shiftx);
  323.    ObjectSet("Box", OBJPROP_YDISTANCE, shifty);
  324.    ObjectSet("Box", OBJPROP_COLOR, BoxColor);
  325.    ObjectSet("Box", OBJPROP_BACK, FALSE);
  326.    ObjectCreate("Box2", OBJ_LABEL, 0, 0, 0, 0, 0);
  327.    ObjectSetText("Box2", "g", 80, "Webdings", BoxColor);
  328.    ObjectSet("Box2", OBJPROP_CORNER, WhatCorner);
  329.    ObjectSet("Box2", OBJPROP_XDISTANCE, shiftx);
  330.    ObjectSet("Box2", OBJPROP_YDISTANCE, shifty + 40);
  331.    ObjectSet("Box2", OBJPROP_COLOR, BoxColor);
  332.    ObjectSet("Box2", OBJPROP_BACK, FALSE);
  333.    ObjectCreate("Pair", OBJ_LABEL, 0, 0, 0);
  334.    ObjectSet("Pair", OBJPROP_XDISTANCE, shiftx + 15);
  335.    ObjectSet("Pair", OBJPROP_YDISTANCE, shifty + 12);
  336.    ObjectSetText("Pair", Symbol(), 14, G_fontname_228, FontColor);
  337.    ObjectSet("Pair", OBJPROP_CORNER, WhatCorner);
  338.    ObjectSet("Pair", OBJPROP_BACK, FALSE);
  339.    ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
  340.    ObjectSetText("Market_Price_Label", dbl2str_112, G_fontsize_220, G_fontname_228, G_color_200);
  341.    ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
  342.    ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, shiftx + 20);
  343.    ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, shifty + 30);
  344.    ObjectSet("Market_Price_Label", OBJPROP_BACK, FALSE);
  345.    ObjectCreate("Spread", OBJ_LABEL, 0, 0, 0);
  346.    ObjectSetText("Spread", "Spread: " + dbl2str_128, G_fontsize_224, "Arial", FontColor);
  347.    ObjectSet("Spread", OBJPROP_CORNER, WhatCorner);
  348.    ObjectSet("Spread", OBJPROP_XDISTANCE, shiftx + 22);
  349.    ObjectSet("Spread", OBJPROP_YDISTANCE, shifty + 55);
  350.    ObjectSet("Spread", OBJPROP_BACK, FALSE);
  351.    ObjectCreate("Trix5mLabel", OBJ_LABEL, 0, 0, 0);
  352.    ObjectSetText("Trix5mLabel", "Tr", 8, "Arial", G_color_188);
  353.    ObjectSet("Trix5mLabel", OBJPROP_CORNER, WhatCorner);
  354.    ObjectSet("Trix5mLabel", OBJPROP_XDISTANCE, shiftx + 75);
  355.    ObjectSet("Trix5mLabel", OBJPROP_YDISTANCE, shifty + 80);
  356.    ObjectSet("Trix5mLabel", OBJPROP_BACK, FALSE);
  357.    ObjectCreate("Trix5m", OBJ_LABEL, 0, 0, 0);
  358.    ObjectSetText("Trix5m", G_text_288, G_fontsize_224 + 2, "WingDings", G_color_188);
  359.    ObjectSet("Trix5m", OBJPROP_CORNER, WhatCorner);
  360.    ObjectSet("Trix5m", OBJPROP_XDISTANCE, shiftx + 68);
  361.    ObjectSet("Trix5m", OBJPROP_YDISTANCE, shifty + 90);
  362.    ObjectSet("Trix5m", OBJPROP_BACK, FALSE);
  363.    ObjectCreate("MaLabel", OBJ_LABEL, 0, 0, 0);
  364.    ObjectSetText("MaLabel", "Ma", 8, "Arial", G_color_192);
  365.    ObjectSet("MaLabel", OBJPROP_CORNER, WhatCorner);
  366.    ObjectSet("MaLabel", OBJPROP_XDISTANCE, shiftx + 47);
  367.    ObjectSet("MaLabel", OBJPROP_YDISTANCE, shifty + 80);
  368.    ObjectSet("MaLabel", OBJPROP_BACK, FALSE);
  369.    ObjectCreate("Ma", OBJ_LABEL, 0, 0, 0);
  370.    ObjectSetText("Ma", G_text_296, G_fontsize_224 + 2, "WingDings", G_color_192);
  371.    ObjectSet("Ma", OBJPROP_CORNER, WhatCorner);
  372.    ObjectSet("Ma", OBJPROP_XDISTANCE, shiftx + 43);
  373.    ObjectSet("Ma", OBJPROP_YDISTANCE, shifty + 90);
  374.    ObjectSet("Ma", OBJPROP_BACK, FALSE);
  375.    ObjectCreate("momLabel", OBJ_LABEL, 0, 0, 0);
  376.    ObjectSetText("momLabel", "Mo", 8, "Arial", G_color_204);
  377.    ObjectSet("momLabel", OBJPROP_CORNER, WhatCorner);
  378.    ObjectSet("momLabel", OBJPROP_XDISTANCE, shiftx + 22);
  379.    ObjectSet("momLabel", OBJPROP_YDISTANCE, shifty + 80);
  380.    ObjectSet("momLabel", OBJPROP_BACK, FALSE);
  381.    ObjectCreate("mom", OBJ_LABEL, 0, 0, 0);
  382.    ObjectSetText("mom", text_184, G_fontsize_224 + 2, "WingDings", G_color_204);
  383.    ObjectSet("mom", OBJPROP_CORNER, WhatCorner);
  384.    ObjectSet("mom", OBJPROP_XDISTANCE, shiftx + 18);
  385.    ObjectSet("mom", OBJPROP_YDISTANCE, shifty + 90);
  386.    ObjectSet("mom", OBJPROP_BACK, FALSE);
  387.    ObjectCreate("Trade", OBJ_LABEL, 0, 0, 0);
  388.    ObjectSetText("Trade", G_text_304, G_fontsize_220, "Arial", G_color_208);
  389.    ObjectSet("Trade", OBJPROP_CORNER, WhatCorner);
  390.    ObjectSet("Trade", OBJPROP_XDISTANCE, shiftx + 45);
  391.    ObjectSet("Trade", OBJPROP_YDISTANCE, shifty + 120);
  392.    ObjectSet("Trade", OBJPROP_BACK, FALSE);
  393.    ObjectCreate("Trade2", OBJ_LABEL, 0, 0, 0);
  394.    ObjectSetText("Trade2", G_text_312, G_fontsize_220, "WingDings", G_color_208);
  395.    ObjectSet("Trade2", OBJPROP_CORNER, WhatCorner);
  396.    ObjectSet("Trade2", OBJPROP_XDISTANCE, shiftx + 15);
  397.    ObjectSet("Trade2", OBJPROP_YDISTANCE, shifty + 120);
  398.    ObjectSet("Trade2", OBJPROP_BACK, FALSE);
  399.    return (0);
  400. }
  401.  
  402. string Get_sPeriod(int Ai_0) {
  403.    if (Ai_0 == 1) return ("M1");
  404.    if (Ai_0 == 5) return ("M5");
  405.    if (Ai_0 == 15) return ("M15");
  406.    if (Ai_0 == 30) return ("M30");
  407.    if (Ai_0 == 60) return ("H1");
  408.    if (Ai_0 == 240) return ("H4");
  409.    if (Ai_0 == 1440) return ("D1");
  410.    if (Ai_0 == 10080) return ("W1");
  411.    if (Ai_0 == 43200) return ("MN1");
  412.    return ("");
  413. }
  414.