kin-2>modify,Martingale Smart

| 发表于 2026-8-14 16:20:15 | 显示全部楼层 |复制链接
  1. //EA交易     =>  ...\MT4\MQL4\Experts
  2. #property  copyright "Copyright  2011,YQL"
  3. #property  link      "https://hisanhe.com"
  4. #property version    "1.01"
  5. #property strict
  6. ////////////////////////////////////////////////////////////////////////
  7. bool     Company_control = false;                                                      // Limit platform switch
  8. bool     Account_Control = false;                                                      // Account Restriction Switch
  9. bool     Time_Control = false;                                                          // Time Limit Switch
  10. string   Company = "";                                                                 // Platform Name
  11. string   Bind_Account = "";                                                            // Bind real account
  12. // Multiple accounts separated by +。Example:="12345+23456+34567";
  13. datetime Use_Expiration_Time = D'2026.01.28 00:00:00';                                 // Use period
  14. string   Company_Error_Reminder_Content = "Platform error, please contact...";                    // Platform error message
  15. string   Account_Error_Reminder_Content = "This account is not linked. Please contact...";                  // Account error notification
  16. string   The_Deadline_Has_Reached_The_Reminder_Content = "The usage period has expired. Please contact us...";     // Expiration reminder
  17. ////////////////////////////////////////////////////////////////////////
  18. enum opentime      {A = 1,//Order time zone mode
  19.                     B = 2,//Order time interval (seconds) mode
  20.                     C = 3//No delay mode
  21.                    };
  22. enum calmethod     {D = 1,//Candle
  23.                     E = 2,//Fractals
  24.                     F = 3 //pips
  25.                    };
  26. //------------------
  27. extern string Authorization = ""  ;    //Unused
  28. extern double On_top_of_this_price_not_Buy_first_order = 0  ;  //No opening (first time) for B and above.
  29. extern double On_under_of_this_price_not_Sell_first_order = 0  ;  //No opening for orders below S (first time).
  30. extern double On_top_of_this_price_not_Buy_order = 0  ;  //B and above are not available (supplementary)) consider for price level
  31. extern double On_under_of_this_price_not_Sell_order = 0  ;  //No openings below S (supplementary).consider for price level
  32. extern string Limit_StartTime = "00:00"  ; //Price limit start time
  33. extern string Limit_StopTime = "24:00"  ; //Price limit end time
  34. extern bool CloseBuySell = true  ;        //Reverse Trend protection switch
  35. extern bool HomeopathyCloseAll = true  ;  //Follow Trend protection switch
  36. extern bool Homeopathy = false ;  //Engage the follow-through switch when fully locked
  37. extern bool Over = false ;  //Stops EA after closed trade
  38. extern int   NextTime = 0  ;  //How many seconds start new trade when  the overall position is closed
  39. extern double Money = 0  ;  //How much loss to enable the second parameter
  40. extern int   FirstStep = 30  ;  //First order distance
  41. extern int   MinDistance = 60  ;  //minimum distance
  42. extern int   TwoMinDistance = 60  ;  //Second minimum distance
  43. extern int   StepTrallOrders = 5  ;  //Second minimum distance
  44. extern int   Step = 100  ;  //Grid spacing
  45. extern int   TwoStep = 100  ;  //Second Grid spacing
  46. extern  opentime  OpenMode = 3  ;
  47. extern  ENUM_TIMEFRAMES  TimeZone = 1  ;  //Order time zone
  48. extern int   sleep = 30  ;  //Order entry time interval (seconds)
  49. extern double MaxLoss = 100000  ;  //Over the max loss to stop add trade
  50. extern double MaxLossCloseAll = 50  ;  //Closing a single-leg position when over loss
  51. extern double lot = 0.01  ;  //Starting lot size
  52. extern double Maxlot = 10  ;  //Maximum number of single moves
  53. extern double PlusLot = 0  ;  //Cumulative number of lots
  54. extern double K_Lot = 1.3  ;  //magnification
  55. extern int   DigitsLot = 2  ;  //Decimal places of order quantity
  56. extern double CloseAll = 0.5  ;  //Total liquidation amount
  57. extern bool Profit = true  ;  //Single-sided closing amount accumulation switch
  58. extern double TargetProfit=30;
  59. bool   Stop_Function=true;
  60. extern double StopProfit = 2  ;  //One-sided closing amount
  61. extern double StopLoss = 0  ;  //Stop loss amount
  62. extern int   Magic = 9527  ;
  63. extern int   Totals = 50  ;  //Maximum order quantity
  64. extern int   MaxSpread = 60  ;  //Spread Limit
  65. extern int   Leverage = 100  ;  //Platform leverage restrictions
  66. extern string EA_StartTime = "00:00"  ; //EA start time
  67. extern string EA_StopTime = "24:00"  ; //EA End Time
  68. extern bool   En_Console=true;
  69. extern color clr1 = MediumSeaGreen  ;  //Average price of multiple orders (color)
  70. extern color clr2 = Crimson  ;  //Average price of short positions (color)
  71. string    Zong_1_st_0 = "";  // Remove the URL from the double quotes, leaving two empty quotes.
  72. string    Zong_2_st_10 = ""; // You can also assign a null value to it to prevent uninitialized warnings
  73. string    Zong_3_st_20 = ""; // Same
  74. string    Zong_4_st_30 = "GoldKylin";
  75. string    Zong_11_st_A0 = "King";
  76. string    Zong_12_st_B0 = "SH";
  77. datetime  Zong_13_da_C0 = 0;
  78. int       Zong_14_in_C8 = 0;
  79. bool      toggle_console = true;
  80. extern    bool Allow_Console = true;
  81. bool      Zong_16_bo_CD = false;
  82. int       XDis_Diff=1250;
  83. string    Zong_17_st_D0 = "StatisticsPanel";
  84. string    Zong_18_st_E0 = "ButtonPanel";
  85. int       Zong_19_in_EC = 9;
  86. uint      Zong_20_ui_F0 = Lime;
  87. string    Zong_21_st_F8 = "Microsoft YaHei";
  88. int       Zong_22_in_104 = 1;
  89. double    Zong_23_do_108 = 0.0;
  90. int       Zong_24_in_110 = 0;
  91. bool      Zong_25_bo_114 = true;
  92. bool      Zong_26_bo_115 = true;
  93. int       Zong_27_in_118 = 30;
  94. double    Zong_28_do_120 = 1.0;
  95. bool      Zong_29_bo_128 = true;
  96. bool      Zong_30_bo_129 = true;
  97. int       Zong_31_in_12C = 1;
  98. int       Zong_32_in_130 = 0;
  99. int       Zong_33_in_134 = 10;
  100. uint      Zong_34_ui_138 = Lime;
  101. uint      Zong_35_ui_13C = Blue;
  102. uint      Zong_36_ui_140 = Red;
  103. datetime  Zong_37_da_148 = 0;
  104. bool      Zong_38_bo_150 = true;
  105. bool      Zong_39_bo_151 = false;
  106. bool      Zong_40_bo_152 = false;
  107. string    Zong_41_st_158 = "";
  108. // "1-Candle  2-Fractals  3-pips";
  109. extern calmethod DetectMethod = 3;
  110. int       Zong_44_in_178 = 20;
  111. int       Zong_45_in_17C = 25;
  112. int       Zong_46_in_180 = 0;
  113. int       Zong_47_in_184 = 15;
  114. int       Zong_48_in_188 = 0;
  115. int       Zong_49_in_18C = 346856;
  116. int       Zong_50_in_190 = 0;
  117. double    Zong_51_do_198 = 0.0;
  118. double    Zong_52_do_1A0 = 0.0;
  119. int       Zong_53_in_1A8 = 1482134400;
  120. string    Zong_54_st_1B0 = "Exness Ltd.";
  121. string    Zong_55_st_1C0 = "CB Financial Services Limited";
  122. int       Zong_56_in_1CC = 1;
  123. int       Zong_57_in_1D0 = 2;
  124. double    Zong_58_do_1D8 = 10.0;
  125. color     Zong_59_co_1E0 = DimGray;
  126. string    Zong_60_st_1E8 = "Spread";
  127. int       Zong_61_in_1F4 = 0;
  128. bool      Zong_62_bo_1F8 = true;
  129. string    Zong_63_st_200 = "Button1";
  130. string    Zong_64_st_210 = "Button2";
  131. string    Zong_65_st_220 = "Button5";
  132. int       Zong_66_in_22C = 55295;
  133. int       Zong_67_in_230 = 16777215;
  134. int       Zong_68_in_234 = 65280;
  135. int       Zong_69_in_238 = 65280;
  136. int       Zong_70_in_23C = 65535;
  137. int       Zong_71_in_240 = 12632256;
  138. string    Zong_72_st_248 = "Lever";
  139. string    Zong_73_st_258 = "Spreads";
  140. int       Zong_74_in_264 = 3;
  141. int       Zong_75_in_268 = 25;
  142. int       Zong_76_in_26C = 30;
  143. bool      Zong_77_bo_270 = false;
  144. string    Zong_78_st_278 = "Amazing Non-Blowout Adjustment Version";
  145. double    Zong_79_do_288 = 0.0;
  146. double    Zong_80_do_290 = 0.0;
  147. int       Zong_81_in_298 = 0;
  148. int       Zong_82_in_29C = 0;
  149. int       Zong_83_in_2A0 = 0;
  150. string    Zong_84_st_2A8 = "000,000,000";
  151. string    Zong_85_st_2B8 = "000,000,255";
  152. int       Zong_86_in_2C4 = 40;
  153. int       Zong_87_in_2C8 = 0;
  154. int       Zong_88_in_2CC = 0;
  155. int       Zong_89_in_2D0 = 0;
  156. datetime  Zong_90_da_2D8 = 0;
  157. datetime  Zong_91_da_2E0 = 0;
  158. datetime  Zong_92_da_2E8 = 0;
  159. datetime  Zong_93_da_2F0 = 0;
  160. datetime  Zong_94_da_2F8 = 0;
  161. long      Zong_95_lo_300 = 0;
  162. long      Zong_96_lo_308 = 0;
  163. int       Zong_97_in_310 = 0;
  164. string    Zong_98_st_318 = "";
  165. string    Zong_99_st_328 = "";
  166. string    Zong_100_st_338 = "";
  167. string    Zong_101_st_348 = "";
  168. string    Zong_102_st_358 = "";
  169. string    Zong_103_st_368 = "";
  170. string    Zong_104_st_378 = "";
  171. string    Zong_105_st_388 = "";
  172. string    Zong_106_st_398 = "";
  173. string    Zong_107_st_3A8 = "";
  174. string    Zong_108_st_3B8 = "";
  175. string    Zong_109_st_3C8 = "";
  176. string    Zong_110_st_3D8 = "";
  177. string    Zong_111_st_3E8 = "";
  178. string    Zong_112_st_3F8 = "";
  179. string    Zong_113_st_408 = "";
  180. string    Zong_114_st_418 = "";
  181. string    Zong_115_st_428 = "";
  182. string    Zong_116_st_438 = "";
  183. string    Zong_117_st_448 = "";
  184. string    Zong_118_st_458 = "";
  185. string    Zong_119_st_468 = "";
  186. string    Zong_120_st_478 = "";
  187. string    Zong_121_st_488 = "";
  188. string    Zong_122_st_498 = "";
  189. string    Zong_123_st_4A8 = "";
  190. string    Zong_124_st_4B8 = "";
  191. string    Zong_125_st_4C8 = "";
  192. string    Zong_126_st_4D8 = "";
  193. string    Zong_127_st_4E8 = "";
  194. string    Zong_128_st_4F8 = "";
  195. string    Zong_129_st_508 = "";
  196. string    Zong_130_st_518 = "";
  197. string    Zong_131_st_528 = "";
  198. string    Zong_132_st_538 = "";
  199. string    Zong_133_st_548 = "";
  200. string    Zong_134_st_558 = "";
  201. string    Zong_135_st_568 = "";
  202. string    Zong_136_st_578 = "";
  203. string    Zong_137_st_588 = "";
  204. string    Zong_138_st_598 = "";
  205. string    Zong_139_st_5A8 = "";
  206. string    Zong_140_st_5B8 = "";
  207. string    Zong_141_st_5C8 = "";
  208. string    Zong_142_st_5D8 = "";
  209. string    Zong_143_st_5E8 = "";
  210. string    Zong_144_st_5F8 = "";
  211. string    Zong_145_st_608 = "";
  212. string    Zong_146_st_618 = "";
  213. string    Zong_147_st_628 = "";
  214. string    Zong_148_st_638 = "";
  215. string    Zong_149_st_648 = "";
  216. string    Zong_150_st_658 = "";
  217. string    Zong_151_st_668 = "";
  218. string    Zong_152_st_678 = "";
  219. string    Zong_153_st_688 = "";
  220. string    Zong_154_st_698 = "";
  221. string    Zong_155_st_6A8 = "";
  222. string    Zong_156_st_6B8 = "";
  223. string    Zong_157_st_6C8 = "";
  224. string    Zong_158_st_6D8 = "";
  225. string    Zong_159_st_6E8 = "";
  226. string    Zong_160_st_6F8 = "";
  227. string    Zong_161_st_708 = "";
  228. string    Zong_162_st_718 = "";
  229. string    Zong_163_st_728 = "";
  230. int       Zong_164_in_734 = 0;
  231. int       Zong_165_in_738 = 0;
  232. double    minStopLoss = MarketInfo(Symbol(),14) ;
  233. bool      CutTodayProfit=false;
  234. int       MyDay;
  235. bool      SetOnce=false;
  236. bool      Start_EA=false;
  237. double    NowProfit;
  238. double    BuyAmount;
  239. double    SellAmount;
  240. //+------------------------------------------------------------------+
  241. //|                                                                  |
  242. //+------------------------------------------------------------------+
  243. int init()
  244.   {
  245.    int       Zi_2_in;
  246.    bool      Zi_3_bo;
  247.    int       Zi_4_in;
  248. //----- -----
  249.    double     Lin_do_1;
  250.    int        Lin_in_2;
  251.    int        Lin_in_3;
  252.    Comment(Zong_102_st_358 + Zong_3_st_20);
  253.    Zi_2_in = 0 ;
  254.    Zi_3_bo = false ;
  255.    Zi_4_in = 0 ;
  256.    Zong_78_st_278 = WindowExpertName() ;
  257.    Zi_2_in = 0 ;
  258.    Zi_3_bo = false ;
  259.    Zi_4_in = 0 ;
  260.    Zong_47_in_184 = lizong_15(Zong_47_in_184) ;
  261.    if((Digits() == 5 || Digits() == 3))
  262.      {
  263.       Zong_50_in_190 = 30 ;
  264.      }
  265.    Comment("");
  266.    Zi_2_in += Zong_33_in_134 * 3;
  267.    Zi_3_bo = false ;
  268.    MaxLossCloseAll = -(MaxLossCloseAll);
  269.    MaxLoss = -(MaxLoss);
  270.    StopLoss = -(StopLoss);
  271.    Money = -(Money);
  272.    if(Zong_78_st_278 != WindowExpertName())
  273.      {
  274.       Comment("");
  275.       Zong_29_bo_128 = false ;
  276.       Zong_30_bo_129 = false ;
  277.       ObjectsDeleteAll(-1, -1);
  278.       if(ObjectFind(Zong_60_st_1E8) <  0)
  279.         {
  280.          ObjectCreate(Zong_60_st_1E8, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  281.          ObjectSet(Zong_60_st_1E8, OBJPROP_CORNER, 1.0);
  282.          ObjectSet(Zong_60_st_1E8, OBJPROP_YDISTANCE, 260.0);
  283.          ObjectSet(Zong_60_st_1E8, OBJPROP_XDISTANCE, 10.0+XDis_Diff);
  284.          ObjectSetText(Zong_60_st_1E8, "Spread: " + DoubleToString((Ask - Bid) / Zong_58_do_1D8, 1) + " pips", 13, "Arial", Zong_59_co_1E0);
  285.         }
  286.       ObjectSetText(Zong_60_st_1E8, "Spread: " + DoubleToString((Ask - Bid) / Zong_58_do_1D8, 1) + " pips", 0, NULL, 0xFFFFFFFF);
  287.       WindowRedraw();
  288.       WindowRedraw();
  289.      }
  290.    PlaySound("Starting.wav");
  291.    StringReplace(EA_StartTime, " ", "");
  292.    StringReplace(EA_StopTime, " ", "");
  293.    StringTrimLeft(EA_StartTime);
  294.    StringTrimLeft(EA_StopTime);
  295.    StringTrimRight(EA_StartTime);
  296.    StringTrimRight(EA_StopTime);
  297.    if(EA_StopTime == "24:00")
  298.      {
  299.       EA_StopTime = "23:59:59" ;
  300.      }
  301.    StringReplace(Limit_StartTime, " ", "");
  302.    StringReplace(Limit_StopTime, " ", "");
  303.    StringTrimLeft(Limit_StartTime);
  304.    StringTrimLeft(Limit_StopTime);
  305.    StringTrimRight(Limit_StartTime);
  306.    StringTrimRight(Limit_StopTime);
  307.    if(Limit_StopTime == "24:00")
  308.      {
  309.       Limit_StopTime = "23:59:59" ;
  310.      }
  311.    EventSetTimer(1);
  312.    Lin_do_1 = 0.0;
  313.    Lin_in_2 = HistoryTotal();
  314.    for(Lin_in_3 = 0 ; Lin_in_3 < Lin_in_2 ; Lin_in_3 = Lin_in_3 + 1)
  315.      {
  316.       if(!(OrderSelect(Lin_in_3, 0, 1)) || OrderType() != 6 || !(OrderProfit() > 0.0))
  317.          continue;
  318.       Lin_do_1 = Lin_do_1 + OrderProfit();
  319.      }
  320.    if(Lin_do_1 == 0.0)
  321.      {
  322.       Lin_do_1 = 100.0;
  323.      }
  324.    Zong_23_do_108 = Lin_do_1 ;
  325.    Print("TotalDeposits=", Zong_23_do_108);
  326.    lizong_20();
  327.    MyDay=DayOfYear();
  328.    sub_CreateButton("Trade","Toggle Trade",1,270,40,Red,Yellow,1,130,40 );
  329.    return(0);
  330.   }
  331. //init <<==--------   --------
  332. int start()
  333.   {
  334.    bool      Zi_2_bo;
  335.    double    Zi_3_do;
  336.    double    Zi_4_do;
  337.    double    Zi_5_do;
  338.    double    Zi_6_do;
  339.    double    Zi_7_do;
  340.    double    Zi_8_do;
  341.    int       Zi_9_in;
  342.    int       Zi_10_in;
  343.    int       Zi_11_in;
  344.    int       Zi_12_in;
  345.    int       Zi_13_in;
  346.    int       Zi_14_in;
  347.    int       Zi_15_in;
  348.    double    Zi_16_do;
  349.    double    Zi_17_do;
  350.    double    Zi_18_do;
  351.    double    Zi_19_do;
  352.    double    Zi_20_do;
  353.    double    Zi_21_do;
  354.    double    Zi_22_do;
  355.    double    Zi_23_do;
  356.    double    Zi_24_do;
  357.    double    Zi_25_do;
  358.    double    Zi_26_do;
  359.    double    Zi_27_do;
  360.    int       Zi_28_in;
  361.    double    Zi_29_do;
  362.    string    Zi_30_st;
  363.    double    Zi_31_do;
  364.    string    Zi_32_st;
  365.    double    Zi_33_do;
  366.    double    Zi_34_do;
  367.    bool      Zi_35_bo;
  368.    double    Zi_36_do;
  369.    double    Zi_37_do;
  370.    double    Zi_38_do;
  371.    double    Zi_39_do;
  372.    double    Zi_40_do;
  373.    datetime  Zi_41_da;
  374.    bool      Zi_42_bo;
  375.    string    Zi_43_st;
  376.    string    Zi_44_st;
  377.    string    Zi_45_st;
  378.    string    Zi_46_st;
  379.    datetime  Zi_47_da;
  380.    string    Zi_49_st;
  381.    string    Zi_50_st;
  382.    string    Zi_51_st;
  383.    string    Zi_52_st;
  384.    datetime  Zi_53_da;
  385.    bool      Zi_54_bo;
  386.    string    Zi_55_st;
  387.    string    Zi_56_st;
  388.    string    Zi_57_st;
  389.    string    Zi_58_st;
  390.    int       Zi_59_in;
  391.    double    Zi_60_do;
  392.    int       Zi_61_in;
  393.    double    Zi_62_do;
  394.    int       Zi_63_in;
  395.    string    Zi_64_st;
  396.    string    Zi_65_st;
  397.    int       Zi_66_in;
  398.    double    Zi_67_do;
  399.    int       Zi_68_in;
  400.    double    Zi_69_do;
  401.    string    Zi_70_st;
  402.    string    Zi_71_st;
  403.    int       Zi_72_in;
  404.    double    Zi_73_do;
  405.    int       Zi_74_in;
  406.    double    Zi_75_do;
  407.    int       Zi_76_in;
  408.    string    Zi_77_st;
  409.    string    Zi_78_st;
  410.    int       Zi_79_in;
  411.    double    Zi_80_do;
  412.    int       Zi_81_in;
  413.    double    Zi_82_do;
  414.    string    Zi_83_st;
  415.    int       Zi_84_in;
  416.    int       Zi_85_in;
  417.    string    Zi_86_st;
  418.    int       Zi_87_in;
  419.    int       Zi_88_in;
  420.    string    Zi_89_st;
  421.    int       Zi_90_in;
  422.    int       Zi_91_in;
  423.    string    Zi_92_st;
  424.    int       Zi_93_in;
  425.    int       Zi_94_in;
  426.    string    Zi_95_st;
  427.    string    Zi_96_st;
  428.    int       Zi_97_in;
  429.    double    Zi_98_do;
  430.    int       Zi_99_in;
  431.    double    Zi_100_do;
  432.    int       Zi_101_in;
  433.    string    Zi_102_st;
  434.    string    Zi_103_st;
  435.    int       Zi_104_in;
  436.    double    Zi_105_do;
  437.    int       Zi_106_in;
  438.    double    Zi_107_do;
  439.    string    Zi_108_st;
  440.    string    Zi_109_st;
  441.    int       Zi_110_in;
  442.    double    Zi_111_do;
  443.    int       Zi_112_in;
  444.    double    Zi_113_do;
  445.    int       Zi_114_in;
  446.    string    Zi_115_st;
  447.    string    Zi_116_st;
  448.    int       Zi_117_in;
  449.    double    Zi_118_do;
  450.    int       Zi_119_in;
  451.    double    Zi_120_do;
  452.    string    Zi_121_st;
  453.    string    Zi_122_st;
  454.    int       Zi_123_in;
  455.    double    Zi_124_do;
  456.    int       Zi_125_in;
  457.    double    Zi_126_do;
  458.    int       Zi_127_in;
  459.    string    Zi_128_st;
  460.    string    Zi_129_st;
  461.    int       Zi_130_in;
  462.    double    Zi_131_do;
  463.    int       Zi_132_in;
  464.    double    Zi_133_do;
  465.    string    Zi_134_st;
  466.    string    Zi_135_st;
  467.    int       Zi_136_in;
  468.    double    Zi_137_do;
  469.    int       Zi_138_in;
  470.    double    Zi_139_do;
  471.    int       Zi_140_in;
  472.    string    Zi_141_st;
  473.    string    Zi_142_st;
  474.    int       Zi_143_in;
  475.    double    Zi_144_do;
  476.    int       Zi_145_in;
  477.    double    Zi_146_do;
  478.    int       Zi_147_in;
  479.    int       Zi_148_in;
  480.    int       Zi_149_in;
  481.    double    Zi_150_do;
  482.    double    Zi_151_do;
  483.    int       Zi_152_in;
  484.    int       Zi_153_in;
  485.    int       Zi_154_in;
  486.    int       Zi_155_in;
  487.    double    Zi_156_do;
  488.    double    Zi_157_do;
  489.    int       Zi_158_in;
  490.    datetime  Zi_159_da;
  491.    bool      Zi_160_bo;
  492.    datetime  Zi_161_da;
  493.    bool      Zi_162_bo;
  494.    datetime  Zi_163_da;
  495.    bool      Zi_164_bo;
  496.    datetime  Zi_165_da;
  497.    bool      Zi_166_bo;
  498.    datetime  Zi_167_da;
  499.    bool      Zi_168_bo;
  500.    datetime  Zi_169_da;
  501.    bool      Zi_170_bo;
  502.    int       Zi_171_in;
  503.    int       Zi_172_in;
  504.    datetime  Zi_173_da;
  505.    int       Zi_174_in;
  506.    int       Zi_175_in;
  507.    datetime  Zi_176_da;
  508.    bool      Zi_177_bo;
  509.    datetime  Zi_178_da;
  510.    bool      Zi_179_bo;
  511.    datetime  Zi_180_da;
  512.    bool      Zi_181_bo;
  513.    datetime  Zi_182_da;
  514.    bool      Zi_183_bo;
  515.    datetime  Zi_184_da;
  516.    bool      Zi_185_bo;
  517.    datetime  Zi_186_da;
  518.    bool      Zi_187_bo;
  519.    int       Zi_188_in;
  520.    int       Zi_189_in;
  521.    datetime  Zi_190_da;
  522.    int       Zi_191_in;
  523.    int       Zi_192_in;
  524.    color     Zi_193_co;
  525.    color     Zi_194_co;
  526.    color     Zi_195_co;
  527.    bool NoData;
  528. //----- -----
  529.    if(!(IsTesting()) && !(lizong_18()))
  530.      {
  531.       Comment(Zong_103_st_368 + Zong_3_st_20);
  532.       ExpertRemove();
  533.       return(0);
  534.      }
  535.    Zi_2_bo = false ;
  536.    Zi_3_do = 0.0 ;
  537.    Zi_4_do = 0.0 ;
  538.    Zi_5_do = 0.0 ;
  539.    Zi_6_do = 0.0 ;
  540.    Zi_7_do = 0.0 ;
  541.    Zi_8_do = 0.0 ;
  542.    Zi_9_in = 0 ;
  543.    Zi_10_in = 0 ;
  544.    Zi_11_in = 0 ;
  545.    Zi_12_in = 0 ;
  546.    Zi_13_in = 0 ;
  547.    Zi_14_in = 0 ;
  548.    Zi_15_in = 0 ;
  549.    Zi_16_do = 0.0 ;
  550.    Zi_17_do = 0.0 ;
  551.    Zi_18_do = 0.0 ;
  552.    Zi_19_do = 0.0 ;
  553.    Zi_20_do = 0.0 ;
  554.    Zi_21_do = 0.0 ;
  555.    Zi_22_do = 0.0 ;
  556.    Zi_23_do = 0.0 ;
  557.    Zi_24_do = 0.0 ;
  558.    Zi_25_do = 0.0 ;
  559.    Zi_26_do = 0.0 ;
  560.    Zi_27_do = 0.0 ;
  561.    Zi_28_in = 0 ;
  562.    Zi_29_do = 0.0 ;
  563.    Zi_31_do = 0.0 ;
  564.    Zi_33_do = 0.0 ;
  565.    Zi_34_do = 0.0 ;
  566.    Zi_35_bo = false ;
  567.    Zi_36_do = 0.0 ;
  568.    Zi_37_do = 0.0 ;
  569.    Zi_38_do = 0.0 ;
  570.    Zi_39_do = 0.0 ;
  571.    Zi_40_do = 0.0 ;
  572.    Zi_41_da = 0 ;
  573.    Zi_42_bo = false ;
  574.    Zi_47_da = 0 ;
  575.    Zi_53_da = 0 ;
  576.    Zi_54_bo = false ;
  577.    Zi_59_in = 0 ;
  578.    Zi_60_do = 0.0 ;
  579.    Zi_61_in = 0 ;
  580.    Zi_62_do = 0.0 ;
  581.    Zi_63_in = 0 ;
  582.    Zi_66_in = 0 ;
  583.    Zi_67_do = 0.0 ;
  584.    Zi_68_in = 0 ;
  585.    Zi_69_do = 0.0 ;
  586.    Zi_72_in = 0 ;
  587.    Zi_73_do = 0.0 ;
  588.    Zi_74_in = 0 ;
  589.    Zi_75_do = 0.0 ;
  590.    Zi_76_in = 0 ;
  591.    Zi_79_in = 0 ;
  592.    Zi_80_do = 0.0 ;
  593.    Zi_81_in = 0 ;
  594.    Zi_82_do = 0.0 ;
  595.    Zi_84_in = 0 ;
  596.    Zi_85_in = 0 ;
  597.    Zi_87_in = 0 ;
  598.    Zi_88_in = 0 ;
  599.    Zi_90_in = 0 ;
  600.    Zi_91_in = 0 ;
  601.    Zi_93_in = 0 ;
  602.    Zi_94_in = 0 ;
  603.    Zi_97_in = 0 ;
  604.    Zi_98_do = 0.0 ;
  605.    Zi_99_in = 0 ;
  606.    Zi_100_do = 0.0 ;
  607.    Zi_101_in = 0 ;
  608.    Zi_104_in = 0 ;
  609.    Zi_105_do = 0.0 ;
  610.    Zi_106_in = 0 ;
  611.    Zi_107_do = 0.0 ;
  612.    Zi_110_in = 0 ;
  613.    Zi_111_do = 0.0 ;
  614.    Zi_112_in = 0 ;
  615.    Zi_113_do = 0.0 ;
  616.    Zi_114_in = 0 ;
  617.    Zi_117_in = 0 ;
  618.    Zi_118_do = 0.0 ;
  619.    Zi_119_in = 0 ;
  620.    Zi_120_do = 0.0 ;
  621.    Zi_123_in = 0 ;
  622.    Zi_124_do = 0.0 ;
  623.    Zi_125_in = 0 ;
  624.    Zi_126_do = 0.0 ;
  625.    Zi_127_in = 0 ;
  626.    Zi_130_in = 0 ;
  627.    Zi_131_do = 0.0 ;
  628.    Zi_132_in = 0 ;
  629.    Zi_133_do = 0.0 ;
  630.    Zi_136_in = 0 ;
  631.    Zi_137_do = 0.0 ;
  632.    Zi_138_in = 0 ;
  633.    Zi_139_do = 0.0 ;
  634.    Zi_140_in = 0 ;
  635.    Zi_143_in = 0 ;
  636.    Zi_144_do = 0.0 ;
  637.    Zi_145_in = 0 ;
  638.    Zi_146_do = 0.0 ;
  639.    Zi_147_in = 0 ;
  640.    Zi_148_in = 0 ;
  641.    Zi_149_in = 0 ;
  642.    Zi_150_do = 0.0 ;
  643.    Zi_151_do = 0.0 ;
  644.    Zi_152_in = 0 ;
  645.    Zi_153_in = 0 ;
  646.    Zi_154_in = 0 ;
  647.    Zi_155_in = 0 ;
  648.    Zi_156_do = 0.0 ;
  649.    Zi_157_do = 0.0 ;
  650.    Zi_158_in = 0 ;
  651.    Zi_159_da = 0 ;
  652.    Zi_160_bo = false ;
  653.    Zi_161_da = 0 ;
  654.    Zi_162_bo = false ;
  655.    Zi_163_da = 0 ;
  656.    Zi_164_bo = false ;
  657.    Zi_165_da = 0 ;
  658.    Zi_166_bo = false ;
  659.    Zi_167_da = 0 ;
  660.    Zi_168_bo = false ;
  661.    Zi_169_da = 0 ;
  662.    Zi_170_bo = false ;
  663.    Zi_171_in = 0 ;
  664.    Zi_172_in = 0 ;
  665.    Zi_173_da = 0 ;
  666.    Zi_174_in = 0 ;
  667.    Zi_175_in = 0 ;
  668.    Zi_176_da = 0 ;
  669.    Zi_177_bo = false ;
  670.    Zi_178_da = 0 ;
  671.    Zi_179_bo = false ;
  672.    Zi_180_da = 0 ;
  673.    Zi_181_bo = false ;
  674.    Zi_182_da = 0 ;
  675.    Zi_183_bo = false ;
  676.    Zi_184_da = 0 ;
  677.    Zi_185_bo = false ;
  678.    Zi_186_da = 0 ;
  679.    Zi_187_bo = false ;
  680.    Zi_188_in = 0 ;
  681.    Zi_189_in = 0 ;
  682.    Zi_190_da = 0 ;
  683.    Zi_191_in = 0 ;
  684.    Zi_192_in = 0 ;
  685.    Zi_193_co = 0 ;
  686.    Zi_194_co = 0 ;
  687.    Zi_195_co = 0 ;
  688.    switch(AccountNumber())
  689.      {
  690.       case 5320061 :
  691.          Zi_2_bo = true ;
  692.          break;
  693.       case 200007738 :
  694.          Zi_2_bo = true ;
  695.          break;
  696.       case 10048166 :
  697.          Zi_2_bo = false ;
  698.          break;
  699.       case 7061521 :
  700.          Zi_2_bo = false ;
  701.          break;
  702.       case 12456 :
  703.          Zi_2_bo = false ;
  704.          break;
  705.       default :
  706.          Zi_2_bo = true ;
  707.      }
  708.    if(Stop_Function==false)
  709.    return 1;  
  710.    if(IsDemo())
  711.      {
  712.       Zi_2_bo = true ;
  713.      }
  714.    if(IsTesting())
  715.      {
  716.       Zi_2_bo = true ;
  717.      }
  718.    Zong_48_in_188 = int(MathMax(MarketInfo(Symbol(), MODE_FREEZELEVEL), MarketInfo(Symbol(), MODE_STOPLEVEL)) + 1.0) ;
  719.    if(Step <  Zong_48_in_188)
  720.      {
  721.       Step = Zong_48_in_188 ;
  722.      }
  723.    if(FirstStep <  Zong_48_in_188)
  724.      {
  725.       FirstStep = Zong_48_in_188 ;
  726.      }
  727.    if(MinDistance <  Zong_48_in_188)
  728.      {
  729.       MinDistance = Zong_48_in_188 ;
  730.      }
  731.    Zi_41_da = GetSystemTime();
  732.    Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_41_da), ".", TimeMonth(Zi_41_da), ".", TimeDay(Zi_41_da), " ", Limit_StartTime)) ;
  733.    Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_41_da), ".", TimeMonth(Zi_41_da), ".", TimeDay(Zi_41_da), " ", Limit_StopTime)) ;
  734.    if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_41_da < Zong_91_da_2E0 || Zi_41_da >  Zong_94_da_2F8))
  735.      {
  736.       ObjectDelete("HLINE_LONG");
  737.       ObjectDelete("HLINE_SHORT");
  738.       ObjectDelete("HLINE_LONGII");
  739.       ObjectDelete("HLINE_SHORTII");
  740.       Zi_42_bo = false ;
  741.      }
  742.    else
  743.      {
  744.       if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_41_da <  Zong_93_da_2F0 && Zi_41_da >  Zong_94_da_2F8)
  745.         {
  746.          ObjectDelete("HLINE_LONG");
  747.          ObjectDelete("HLINE_SHORT");
  748.          ObjectDelete("HLINE_LONGII");
  749.          ObjectDelete("HLINE_SHORTII");
  750.          Zi_42_bo = false ;
  751.         }
  752.       else
  753.         {
  754.          Zi_42_bo = true ;
  755.         }
  756.      }
  757.    if(Zi_42_bo)
  758.      {
  759.       if(On_top_of_this_price_not_Buy_first_order != 0.0)
  760.         {
  761.          ObjectCreate(0, "HLINE_LONG", OBJ_HLINE, 0, 0, On_top_of_this_price_not_Buy_first_order);
  762.          ObjectSet("HLINE_LONG", OBJPROP_STYLE, 0.0);
  763.          ObjectSet("HLINE_LONG", OBJPROP_COLOR, 10025880.0);
  764.         }
  765.       if(On_under_of_this_price_not_Sell_first_order != 0.0)
  766.         {
  767.          ObjectCreate(0, "HLINE_SHORT", OBJ_HLINE, 0, 0, On_under_of_this_price_not_Sell_first_order);
  768.          ObjectSet("HLINE_SHORT", OBJPROP_STYLE, 0.0);
  769.          ObjectSet("HLINE_SHORT", OBJPROP_COLOR, 16711935.0);
  770.         }
  771.       if(On_top_of_this_price_not_Buy_order != 0.0)
  772.         {
  773.          ObjectCreate(0, "HLINE_LONGII", OBJ_HLINE, 0, 0, On_top_of_this_price_not_Buy_order);
  774.          ObjectSet("HLINE_LONGII", OBJPROP_STYLE, 2.0);
  775.          ObjectSet("HLINE_LONGII", OBJPROP_COLOR, 10025880.0);
  776.         }
  777.       if(On_under_of_this_price_not_Sell_order != 0.0)
  778.         {
  779.          ObjectCreate(0, "HLINE_SHORTII", OBJ_HLINE, 0, 0, On_under_of_this_price_not_Sell_order);
  780.          ObjectSet("HLINE_SHORTII", OBJPROP_STYLE, 2.0);
  781.          ObjectSet("HLINE_SHORTII", OBJPROP_COLOR, 16711935.0);
  782.         }
  783.      }
  784.    Zi_3_do = 0.0 ;
  785.    Zi_4_do = 0.0 ;
  786.    Zi_5_do = 0.0 ;
  787.    Zi_6_do = 0.0 ;
  788.    Zi_7_do = 0.0 ;
  789.    Zi_8_do = 0.0 ;
  790.    Zi_9_in = 0 ;
  791.    Zi_10_in = 0 ;
  792.    Zi_11_in = 0 ;
  793.    Zi_12_in = 0 ;
  794.    Zi_13_in = 0 ;
  795.    Zi_14_in = 0 ;
  796.    Zi_15_in = 0 ;
  797.    Zi_16_do = 0.0 ;
  798.    Zi_17_do = 0.0 ;
  799.    Zi_18_do = 0.0 ;
  800.    Zi_19_do = 0.0 ;
  801.    Zi_20_do = 0.0 ;
  802.    Zi_21_do = 0.0 ;
  803.    Zi_22_do = 0.0 ;
  804.    Zi_23_do = 0.0 ;
  805.    Zi_24_do = 0.0 ;
  806.    Zi_25_do = 0.0 ;
  807.    Zi_26_do = 0.0 ;
  808.    Zi_27_do = 0.0 ;
  809.    Zi_28_in = 0 ;
  810.    Zi_29_do = 0.0 ;
  811.    Zi_31_do = 0.0 ;
  812.    Zi_33_do = 0.0 ;
  813.    Zi_34_do = 0.0 ;
  814.    Zi_35_bo = false ;
  815.    for(Zi_28_in = 0 ; Zi_28_in < OrdersTotal() ; Zi_28_in ++)
  816.      {
  817.       if(!(OrderSelect(Zi_28_in, 0, 0)) || OrderSymbol() != Symbol() || Magic != OrderMagicNumber())
  818.          continue;
  819.       Zi_13_in = OrderType() ;
  820.       Zi_8_do = OrderLots() ;
  821.       Zi_3_do = NormalizeDouble(OrderOpenPrice(), Digits()) ;
  822.       if(Zi_13_in == 4) //BUY Stop
  823.         {
  824.          Zi_11_in ++;
  825.          if((Zi_16_do < Zi_3_do || Zi_16_do == 0.0))
  826.            {
  827.             Zi_16_do = Zi_3_do ;
  828.            }
  829.          Zi_14_in = OrderTicket() ;
  830.          Zi_20_do = Zi_3_do ;
  831.         }
  832.       if(Zi_13_in == 5) //SELL Stop
  833.         {
  834.          Zi_12_in ++;
  835.          if((Zi_19_do > Zi_3_do || Zi_19_do == 0.0))
  836.            {
  837.             Zi_19_do = Zi_3_do ;
  838.            }
  839.          Zi_15_in = OrderTicket() ;
  840.          Zi_21_do = Zi_3_do ;
  841.         }
  842.       if(Zi_13_in == 0) //BUY
  843.         {
  844.          Zi_9_in ++;
  845.          Zi_6_do = Zi_6_do + Zi_8_do ;
  846.          Zi_23_do = Zi_3_do * Zi_8_do + Zi_23_do ;
  847.          if((Zi_16_do < Zi_3_do || Zi_16_do == 0.0))
  848.            {
  849.             Zi_16_do = Zi_3_do ;
  850.            }
  851.          if((Zi_17_do > Zi_3_do || Zi_17_do == 0.0))
  852.            {
  853.             Zi_17_do = Zi_3_do ;
  854.            }
  855.          Zi_5_do = OrderProfit() + OrderSwap() + OrderCommission() + Zi_5_do ;
  856.         }
  857.       if(Zi_13_in != 1)
  858.          continue;
  859.       Zi_10_in ++;      //SELL
  860.       Zi_7_do = Zi_7_do + Zi_8_do ;
  861.       Zi_22_do = Zi_3_do * Zi_8_do + Zi_22_do ;
  862.       if((Zi_19_do > Zi_3_do || Zi_19_do == 0.0))
  863.         {
  864.          Zi_19_do = Zi_3_do ;
  865.         }
  866.       if((Zi_18_do < Zi_3_do || Zi_18_do == 0.0))
  867.         {
  868.          Zi_18_do = Zi_3_do ;
  869.         }
  870.       Zi_4_do = OrderProfit() + OrderSwap() + OrderCommission() + Zi_4_do ;
  871.      }
  872.      if(CutTodayProfit==false)
  873.      {
  874.       if((NowProfit + Zi_5_do + Zi_4_do)> TargetProfit)
  875.       {
  876.          CutTodayProfit=true;
  877.          lizong_13(0);
  878.          SetOnce=false;
  879.       }   
  880.      }
  881.    if(Zi_5_do > 0.0)
  882.      {
  883.       ObjectSetInteger(0, Zong_63_st_200, OBJPROP_BGCOLOR, 17919);
  884.      }
  885.    else
  886.      {
  887.       ObjectSetInteger(0, Zong_63_st_200, OBJPROP_BGCOLOR, 6908265);
  888.      }
  889.    if(Zi_4_do > 0.0)
  890.      {
  891.       ObjectSetInteger(0, Zong_64_st_210, OBJPROP_BGCOLOR, 17919);
  892.      }
  893.    else
  894.      {
  895.       ObjectSetInteger(0, Zong_64_st_210, OBJPROP_BGCOLOR, 6908265);
  896.      }
  897.    if(Zi_5_do + Zi_4_do > 0.0)
  898.      {
  899.       ObjectSetInteger(0, Zong_65_st_220, OBJPROP_BGCOLOR, 17919);
  900.      }
  901.    else
  902.      {
  903.       ObjectSetInteger(0, Zong_65_st_220, OBJPROP_BGCOLOR, 6908265);
  904.      }
  905.    if(Zi_6_do > 0.0 && Zi_7_do / Zi_6_do > 3.0 && Zi_7_do - Zi_6_do > 0.2)
  906.      {
  907.       Zong_39_bo_151 = true ;
  908.      }
  909.    else
  910.      {
  911.       Zong_39_bo_151 = false ;
  912.      }
  913.    if(Zi_7_do > 0.0 && Zi_6_do / Zi_7_do > 3.0 && Zi_6_do - Zi_7_do > 0.2)
  914.      {
  915.       Zong_40_bo_152 = true ;
  916.      }
  917.    else
  918.      {
  919.       Zong_40_bo_152 = false ;
  920.      }
  921.    Zi_36_do = 0.0 ;
  922.    Zi_37_do = 0.0 ;
  923.    Zi_38_do = 0.0 ;
  924.    Zi_39_do = 0.0 ;
  925.    Zi_36_do = iHigh(Symbol(), Zong_31_in_12C, 0) - iLow(Symbol(), Zong_31_in_12C, 5) ;
  926.    Zi_38_do = iLow(Symbol(), Zong_31_in_12C, 0) - iHigh(Symbol(), Zong_31_in_12C, 5) ;
  927.    Zi_37_do = int(Zi_36_do / Point()) ;
  928.    Zi_39_do = MathAbs(Zi_38_do / Point());
  929.    if((AccountLeverage() < Leverage || IsTradeAllowed() == false || IsExpertEnabled() == false || IsStopped() || Zi_9_in + Zi_10_in >= Totals || MarketInfo(Symbol(), MODE_SPREAD) > MaxSpread || (Zong_32_in_130 != 0 && Zi_37_do >= Zong_32_in_130) || (Zong_32_in_130 != 0 && Zi_39_do >= Zong_32_in_130)))
  930.      {
  931.       Zong_29_bo_128 = false ;
  932.       Zong_30_bo_129 = false ;
  933.       Zi_43_st = "Arial" ;
  934.       Zi_44_st = "EA stops running if  not meet requirement.!" ;
  935.       if(ObjectFind("Stop") == -1)
  936.         {
  937.          ObjectCreate("Stop", OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  938.          ObjectSet("Stop", OBJPROP_CORNER, Zong_74_in_264);
  939.          ObjectSet("Stop", OBJPROP_XDISTANCE, Zong_75_in_268+XDis_Diff);
  940.          ObjectSet("Stop", OBJPROP_YDISTANCE, Zong_76_in_26C);
  941.         }
  942.       ObjectSetText("Stop", Zi_44_st, Zong_33_in_134, Zi_43_st, Zong_59_co_1E0);
  943.      }
  944.    else
  945.      {
  946.       Zong_29_bo_128 = true ;
  947.       Zong_30_bo_129 = true ;
  948.       Zi_45_st = "Arial" ;
  949.       Zi_46_st = "" ;
  950.       if(ObjectFind("Stop") == -1)
  951.         {
  952.          ObjectCreate("Stop", OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  953.          ObjectSet("Stop", OBJPROP_CORNER, Zong_74_in_264);
  954.          ObjectSet("Stop", OBJPROP_XDISTANCE, Zong_75_in_268+XDis_Diff);
  955.          ObjectSet("Stop", OBJPROP_YDISTANCE, Zong_76_in_26C);
  956.         }
  957.       ObjectSetText("Stop", Zi_46_st, Zong_33_in_134, Zi_45_st, Zong_59_co_1E0);
  958.      }
  959.    Zi_47_da = GetSystemTime();
  960.    Zong_91_da_2E0 = StringToTime(StringConcatenate(TimeYear(Zi_47_da), ".", TimeMonth(Zi_47_da), ".", TimeDay(Zi_47_da), " ", EA_StartTime)) ;
  961.    if(TimeDayOfWeek(GetSystemTime()) == 5)
  962.    Zong_92_da_2E8 = StringToTime(StringConcatenate(TimeYear(Zi_47_da), ".", TimeMonth(Zi_47_da), ".", TimeDay(Zi_47_da), " ", "13:00")) ;
  963.    else
  964.    Zong_92_da_2E8 = StringToTime(StringConcatenate(TimeYear(Zi_47_da), ".", TimeMonth(Zi_47_da), ".", TimeDay(Zi_47_da), " ", EA_StopTime)) ;
  965.    if(Zong_91_da_2E0 <  Zong_92_da_2E8 && (Zi_47_da < Zong_91_da_2E0 || Zi_47_da >  Zong_92_da_2E8))
  966.      {
  967.       Start_EA = false ;
  968.      }
  969.    else
  970.      {
  971.       if(Zong_91_da_2E0 >  Zong_92_da_2E8 && Zi_47_da <  Zong_91_da_2E0 && Zi_47_da >  Zong_92_da_2E8)
  972.         {
  973.          Start_EA = false ;
  974.         }
  975.       else
  976.         {
  977.          Start_EA = true ;
  978.         }
  979.      }
  980.    if(DayOfYear()!=MyDay)
  981.     {
  982.        MyDay=DayOfYear();
  983.        CutTodayProfit=false;
  984.     }     
  985.    if(CutTodayProfit==true)
  986.    {
  987.       if(SetOnce==false)
  988.       {
  989.          SetOnce=true;
  990.          lizong_20();
  991.       }   
  992.       Stop_Function=false;
  993.       ObjectSet( "Trade",OBJPROP_BGCOLOR,Red);
  994.       return 1;               
  995.    }   
  996.    if(!(Start_EA))
  997.      {
  998.       Zi_49_st = "Arial" ;
  999.       Zi_50_st = "Do not open positions during non-position opening periods!" ;
  1000.       if(ObjectFind("Stop") == -1)
  1001.         {
  1002.          ObjectCreate("Stop", OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  1003.          ObjectSet("Stop", OBJPROP_CORNER, Zong_74_in_264);
  1004.          ObjectSet("Stop", OBJPROP_XDISTANCE, Zong_75_in_268+XDis_Diff);
  1005.          ObjectSet("Stop", OBJPROP_YDISTANCE, Zong_76_in_26C);
  1006.         }
  1007.       ObjectSetText("Stop", Zi_50_st, Zong_33_in_134, Zi_49_st, Zong_59_co_1E0);
  1008.       NoData=false;
  1009.       if((Zi_9_in+Zi_10_in)!=0)
  1010.       {
  1011.          NoData=true;
  1012.          if((Zi_4_do+ Zi_5_do)>-10)
  1013.          {
  1014.             lizong_13(0);
  1015.             NoData=false;
  1016.          }
  1017.       }
  1018.       if(NoData==false)
  1019.       {
  1020.          lizong_20();
  1021.          return 1;
  1022.       }   
  1023.      }
  1024.    if(Zong_78_st_278 != WindowExpertName())
  1025.      {
  1026.       Zong_29_bo_128 = false ;
  1027.       Zong_30_bo_129 = false ;
  1028.       Zi_51_st = "Arial" ;
  1029.       Zi_52_st = "EA已切换,停止交易! " ;
  1030.       if(ObjectFind("Stop") == -1)
  1031.         {
  1032.          ObjectCreate("Stop", OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  1033.          ObjectSet("Stop", OBJPROP_CORNER, Zong_74_in_264);
  1034.          ObjectSet("Stop", OBJPROP_XDISTANCE, Zong_75_in_268+XDis_Diff);
  1035.          ObjectSet("Stop", OBJPROP_YDISTANCE, Zong_76_in_26C);
  1036.         }
  1037.       ObjectSetText("Stop", Zi_52_st, Zong_33_in_134, Zi_51_st, Zong_59_co_1E0);
  1038.      }
  1039.    if(GetSystemTime() <  Zong_37_da_148)
  1040.      {
  1041.       Zi_53_da = GetSystemTime();
  1042.       Zong_91_da_2E0 = StringToTime(StringConcatenate(TimeYear(Zi_53_da), ".", TimeMonth(Zi_53_da), ".", TimeDay(Zi_53_da), " ", EA_StartTime)) ;
  1043.       Zong_92_da_2E8 = StringToTime(StringConcatenate(TimeYear(Zi_53_da), ".", TimeMonth(Zi_53_da), ".", TimeDay(Zi_53_da), " ", EA_StopTime)) ;
  1044.       if(Zong_91_da_2E0 <  Zong_92_da_2E8 && (Zi_53_da < Zong_91_da_2E0 || Zi_53_da >  Zong_92_da_2E8))
  1045.         {
  1046.          Zi_54_bo = false ;
  1047.         }
  1048.       else
  1049.         {
  1050.          if(Zong_91_da_2E0 >  Zong_92_da_2E8 && Zi_53_da <  Zong_91_da_2E0 && Zi_53_da >  Zong_92_da_2E8)
  1051.            {
  1052.             Zi_54_bo = false ;
  1053.            }
  1054.          else
  1055.            {
  1056.             Zi_54_bo = true ;
  1057.            }
  1058.         }
  1059.       if(Zi_54_bo)
  1060.         {
  1061.          Zong_29_bo_128 = false ;
  1062.          Zong_30_bo_129 = false ;
  1063.          Zi_55_st = "Arial" ;
  1064.          Zi_56_st = "EA停止运行 " + string(NextTime) + "秒! " ;
  1065.          if(ObjectFind("Stop") == -1)
  1066.            {
  1067.             ObjectCreate("Stop", OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  1068.             ObjectSet("Stop", OBJPROP_CORNER, Zong_74_in_264);
  1069.             ObjectSet("Stop", OBJPROP_XDISTANCE, Zong_75_in_268+XDis_Diff);
  1070.             ObjectSet("Stop", OBJPROP_YDISTANCE, Zong_76_in_26C);
  1071.            }
  1072.          ObjectSetText("Stop", Zi_56_st, Zong_33_in_134, Zi_55_st, Zong_59_co_1E0);
  1073.         }
  1074.      }
  1075.    if(Over == 1 && Zi_9_in == 0)
  1076.      {
  1077.       Zong_29_bo_128 = false ;
  1078.      }
  1079.    if(Over == 1 && Zi_10_in == 0)
  1080.      {
  1081.       Zong_30_bo_129 = false ;
  1082.      }
  1083.    ObjectDelete("SLb");
  1084.    ObjectDelete("SLs");
  1085.    if(Zi_9_in >  0)
  1086.      {
  1087.       Zi_24_do = NormalizeDouble(Zi_23_do / Zi_6_do, Digits()) ;
  1088.       if(ObjectFind("SLb") != -1)
  1089.         {
  1090.          ObjectMove("SLb", 0, iTime(Symbol(), PERIOD_M1, 5 - 1), Zi_24_do);
  1091.          ObjectMove("SLb", 1, iTime(Symbol(), PERIOD_M1, 0), Zi_24_do);
  1092.         }
  1093.       else
  1094.         {
  1095.          ObjectCreate("SLb", OBJ_TREND, 0, iTime(Symbol(), PERIOD_M1, 5 - 1), Zi_24_do, iTime(Symbol(), PERIOD_M1, 0), Zi_24_do, 0, 0.0);
  1096.          ObjectSet("SLb", OBJPROP_COLOR, clr1);
  1097.          ObjectSet("SLb", OBJPROP_STYLE, 0.0);
  1098.          ObjectSet("SLb", OBJPROP_WIDTH, 2.0);
  1099.          ObjectSet("SLb", OBJPROP_BACK, 0.0);
  1100.          ObjectSet("SLb", 1004, 0.0);
  1101.         }
  1102.      }
  1103.    if(Zi_10_in >  0)
  1104.      {
  1105.       Zi_25_do = NormalizeDouble(Zi_22_do / Zi_7_do, Digits()) ;
  1106.       if(ObjectFind("SLs") != -1)
  1107.         {
  1108.          ObjectMove("SLs", 0, iTime(Symbol(), PERIOD_M1, 5 - 1), Zi_25_do);
  1109.          ObjectMove("SLs", 1, iTime(Symbol(), PERIOD_M1, 0), Zi_25_do);
  1110.         }
  1111.       else
  1112.         {
  1113.          ObjectCreate("SLs", OBJ_TREND, 0, iTime(Symbol(), PERIOD_M1, 5 - 1), Zi_25_do, iTime(Symbol(), PERIOD_M1, 0), Zi_25_do, 0, 0.0);
  1114.          ObjectSet("SLs", OBJPROP_COLOR, clr2);
  1115.          ObjectSet("SLs", OBJPROP_STYLE, 0.0);
  1116.          ObjectSet("SLs", OBJPROP_WIDTH, 2.0);
  1117.          ObjectSet("SLs", OBJPROP_BACK, 0.0);
  1118.          ObjectSet("SLs", 1004, 0.0);
  1119.         }
  1120.      }
  1121.    ObjectSetText("Char.op", CharToString(74), Zong_33_in_134 + 2, "Wingdings", Red);
  1122.    Zi_40_do = Zi_5_do + Zi_4_do ;
  1123.    if(Over == 1 && Zi_40_do >= CloseAll)
  1124.      {
  1125.       Zong_29_bo_128 = false ;
  1126.       Zong_30_bo_129 = false ;
  1127.       Zi_57_st = "Order number" ;
  1128.       Zi_58_st = "sell" ;
  1129.       Zi_59_in = 0 ;
  1130.       Zi_60_do = 0.0 ;
  1131.       for(Zi_61_in = OrdersTotal() - 1 ; Zi_61_in >= 0 ; Zi_61_in --)
  1132.         {
  1133.          if(!(OrderSelect(Zi_61_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1134.             continue;
  1135.          if(Zi_58_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_59_in)
  1136.            {
  1137.             OrderOpenTime();
  1138.             OrderOpenPrice();
  1139.             Zi_60_do = OrderLots() ;
  1140.             Zi_59_in = OrderTicket() ;
  1141.            }
  1142.          if(Zi_58_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_59_in)
  1143.             continue;
  1144.          OrderOpenTime();
  1145.          OrderOpenPrice();
  1146.          Zi_60_do = OrderLots() ;
  1147.          Zi_59_in = OrderTicket() ;
  1148.         }
  1149.       if(Zi_57_st == "Order number")
  1150.         {
  1151.          Zi_62_do = Zi_59_in ;
  1152.         }
  1153.       else
  1154.         {
  1155.          if(Zi_57_st == "Lot")
  1156.            {
  1157.             Zi_62_do = Zi_60_do ;
  1158.            }
  1159.          else
  1160.            {
  1161.             Zi_62_do = 0.0 ;
  1162.            }
  1163.         }
  1164.       Zi_63_in = (int)Zi_62_do ;
  1165.       Zi_64_st = "Order number" ;
  1166.       Zi_65_st = "buy" ;
  1167.       Zi_66_in = 0 ;
  1168.       Zi_67_do = 0.0 ;
  1169.       for(Zi_68_in = OrdersTotal() - 1 ; Zi_68_in >= 0 ; Zi_68_in --)
  1170.         {
  1171.          if(!(OrderSelect(Zi_68_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1172.             continue;
  1173.          if(Zi_65_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_66_in)
  1174.            {
  1175.             OrderOpenTime();
  1176.             OrderOpenPrice();
  1177.             Zi_67_do = OrderLots() ;
  1178.             Zi_66_in = OrderTicket() ;
  1179.            }
  1180.          if(Zi_65_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_66_in)
  1181.             continue;
  1182.          OrderOpenTime();
  1183.          OrderOpenPrice();
  1184.          Zi_67_do = OrderLots() ;
  1185.          Zi_66_in = OrderTicket() ;
  1186.         }
  1187.       if(Zi_64_st == "Order number")
  1188.         {
  1189.          Zi_69_do = Zi_66_in ;
  1190.         }
  1191.       else
  1192.         {
  1193.          if(Zi_64_st == "Lot")
  1194.            {
  1195.             Zi_69_do = Zi_67_do ;
  1196.            }
  1197.          else
  1198.            {
  1199.             Zi_69_do = 0.0 ;
  1200.            }
  1201.         }
  1202.       if(OrderCloseBy((int)Zi_69_do, Zi_63_in, 0xFFFFFFFF))
  1203.         {
  1204.          do
  1205.            {
  1206.             Zi_70_st = "Order number" ;
  1207.             Zi_71_st = "sell" ;
  1208.             Zi_72_in = 0 ;
  1209.             Zi_73_do = 0.0 ;
  1210.             for(Zi_74_in = OrdersTotal() - 1 ; Zi_74_in >= 0 ; Zi_74_in --)
  1211.               {
  1212.                if(!(OrderSelect(Zi_74_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1213.                   continue;
  1214.                if(Zi_71_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_72_in)
  1215.                  {
  1216.                   OrderOpenTime();
  1217.                   OrderOpenPrice();
  1218.                   Zi_73_do = OrderLots() ;
  1219.                   Zi_72_in = OrderTicket() ;
  1220.                  }
  1221.                if(Zi_71_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_72_in)
  1222.                   continue;
  1223.                OrderOpenTime();
  1224.                OrderOpenPrice();
  1225.                Zi_73_do = OrderLots() ;
  1226.                Zi_72_in = OrderTicket() ;
  1227.               }
  1228.             if(Zi_70_st == "Order number")
  1229.               {
  1230.                Zi_75_do = Zi_72_in ;
  1231.               }
  1232.             else
  1233.               {
  1234.                if(Zi_70_st == "Lot")
  1235.                  {
  1236.                   Zi_75_do = Zi_73_do ;
  1237.                  }
  1238.                else
  1239.                  {
  1240.                   Zi_75_do = 0.0 ;
  1241.                  }
  1242.               }
  1243.             Zi_76_in = (int)Zi_75_do ;
  1244.             Zi_77_st = "Order number" ;
  1245.             Zi_78_st = "buy" ;
  1246.             Zi_79_in = 0 ;
  1247.             Zi_80_do = 0.0 ;
  1248.             for(Zi_81_in = OrdersTotal() - 1 ; Zi_81_in >= 0 ; Zi_81_in --)
  1249.               {
  1250.                if(!(OrderSelect(Zi_81_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1251.                   continue;
  1252.                if(Zi_78_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_79_in)
  1253.                  {
  1254.                   OrderOpenTime();
  1255.                   OrderOpenPrice();
  1256.                   Zi_80_do = OrderLots() ;
  1257.                   Zi_79_in = OrderTicket() ;
  1258.                  }
  1259.                if(Zi_78_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_79_in)
  1260.                   continue;
  1261.                OrderOpenTime();
  1262.                OrderOpenPrice();
  1263.                Zi_80_do = OrderLots() ;
  1264.                Zi_79_in = OrderTicket() ;
  1265.               }
  1266.             if(Zi_77_st == "Order number")
  1267.               {
  1268.                Zi_82_do = Zi_79_in ;
  1269.               }
  1270.             else
  1271.               {
  1272.                if(Zi_77_st == "Lot")
  1273.                  {
  1274.                   Zi_82_do = Zi_80_do ;
  1275.                  }
  1276.                else
  1277.                  {
  1278.                   Zi_82_do = 0.0 ;
  1279.                  }
  1280.               }
  1281.            }
  1282.          while(OrderCloseBy((int)Zi_82_do, Zi_76_in, 0xFFFFFFFF));
  1283.         }
  1284.       lizong_14(0);
  1285.       if(ObjectFind(Zong_60_st_1E8) <  0)
  1286.         {
  1287.          ObjectCreate(Zong_60_st_1E8, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  1288.          ObjectSet(Zong_60_st_1E8, OBJPROP_CORNER, 1.0);
  1289.          ObjectSet(Zong_60_st_1E8, OBJPROP_YDISTANCE, 260.0);
  1290.          ObjectSet(Zong_60_st_1E8, OBJPROP_XDISTANCE, 10.0+XDis_Diff);
  1291.          ObjectSetText(Zong_60_st_1E8, "Spread: " + DoubleToString((Ask - Bid) / Zong_58_do_1D8, 1) + " Point", 13, "Arial", Zong_59_co_1E0);
  1292.         }
  1293.       ObjectSetText(Zong_60_st_1E8, "Spread: " + DoubleToString((Ask - Bid) / Zong_58_do_1D8, 1) + " Point", 0, NULL, 0xFFFFFFFF);
  1294.       WindowRedraw();
  1295.       WindowRedraw();
  1296.      }
  1297.    if(Over == false)
  1298.      {
  1299.       if(HomeopathyCloseAll == true)
  1300.         {
  1301.          Zi_83_st = "buy" ;
  1302.          Zi_84_in = 0 ;
  1303.          for(Zi_85_in = OrdersTotal() - 1 ; Zi_85_in >= 0 ; Zi_85_in --)
  1304.            {
  1305.             if(!(OrderSelect(Zi_85_in, 0, 0)) || Symbol() != OrderSymbol() || OrderMagicNumber() != Magic || OrderComment() != "SS")
  1306.                continue;
  1307.             if(Zi_83_st == "buy" && OrderType() == 0)
  1308.               {
  1309.                Zi_84_in ++;
  1310.               }
  1311.             if(Zi_83_st != "sell" || OrderType() != 1)
  1312.                continue;
  1313.             Zi_84_in ++;
  1314.            }
  1315.          if(Zi_84_in <  1)
  1316.            {
  1317.             Zi_86_st = "sell" ;
  1318.             Zi_87_in = 0 ;
  1319.             for(Zi_88_in = OrdersTotal() - 1 ; Zi_88_in >= 0 ; Zi_88_in --)
  1320.               {
  1321.                if(!(OrderSelect(Zi_88_in, 0, 0)) || Symbol() != OrderSymbol() || OrderMagicNumber() != Magic || OrderComment() != "SS")
  1322.                   continue;
  1323.                if(Zi_86_st == "buy" && OrderType() == 0)
  1324.                  {
  1325.                   Zi_87_in ++;
  1326.                  }
  1327.                if(Zi_86_st != "sell" || OrderType() != 1)
  1328.                   continue;
  1329.                Zi_87_in ++;
  1330.               }
  1331.            }
  1332.         }
  1333.       if((Zi_87_in < 1 || HomeopathyCloseAll == false) && (Zi_5_do > MaxLossCloseAll && Zi_4_do > MaxLossCloseAll))
  1334.       {
  1335.          ObjectSetText("Char.op", CharToString(251), Zong_33_in_134 + 2, "Wingdings", Silver);
  1336.          if(((Profit == true && Zi_5_do > StopProfit * Zi_9_in) || (Profit == false && Zi_5_do > StopProfit)))
  1337.            {
  1338.             Print("Close Loss ", Zi_5_do);
  1339.             lizong_14(1);
  1340.             return(0);
  1341.            }
  1342.          if(((Profit == true && Zi_4_do > StopProfit * Zi_10_in) || (Profit == false && Zi_4_do > StopProfit)))
  1343.           {
  1344.             Print("Profit from Sell ", Zi_4_do);
  1345.             lizong_14(-1);
  1346.             return(0);
  1347.            }
  1348.         }
  1349.       if(HomeopathyCloseAll == true)
  1350.         {
  1351.          Zi_89_st = "buy" ;
  1352.          Zi_90_in = 0 ;
  1353.          for(Zi_91_in = OrdersTotal() - 1 ; Zi_91_in >= 0 ; Zi_91_in --)
  1354.            {
  1355.             if(!(OrderSelect(Zi_91_in, 0, 0)) || Symbol() != OrderSymbol() || OrderMagicNumber() != Magic || OrderComment() != "SS")
  1356.                continue;
  1357.             if(Zi_89_st == "buy" && OrderType() == 0)
  1358.               {
  1359.                Zi_90_in ++;
  1360.               }
  1361.             if(Zi_89_st != "sell" || OrderType() != 1)
  1362.                continue;
  1363.             Zi_90_in ++;
  1364.            }
  1365.          Zi_92_st = "sell" ;
  1366.          Zi_93_in = 0 ;
  1367.          for(Zi_94_in = OrdersTotal() - 1 ; Zi_94_in >= 0 ; Zi_94_in --)
  1368.            {
  1369.             if(!(OrderSelect(Zi_94_in, 0, 0)) || Symbol() != OrderSymbol() || OrderMagicNumber() != Magic || OrderComment() != "SS")
  1370.                continue;
  1371.             if(Zi_92_st == "buy" && OrderType() == 0)
  1372.               {
  1373.                Zi_93_in ++;
  1374.               }
  1375.             if(Zi_92_st != "sell" || OrderType() != 1)
  1376.                continue;
  1377.             Zi_93_in ++;
  1378.            }
  1379.          if((Zi_90_in > 0 || Zi_93_in >  0) && Zi_5_do + Zi_4_do >= CloseAll)
  1380.            {
  1381.             Zi_95_st = "Order number" ;
  1382.             Zi_96_st = "sell" ;
  1383.             Zi_97_in = 0 ;
  1384.             Zi_98_do = 0.0 ;
  1385.             for(Zi_99_in = OrdersTotal() - 1 ; Zi_99_in >= 0 ; Zi_99_in --)
  1386.               {
  1387.                if(!(OrderSelect(Zi_99_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1388.                   continue;
  1389.                if(Zi_96_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_97_in)
  1390.                  {
  1391.                   OrderOpenTime();
  1392.                   OrderOpenPrice();
  1393.                   Zi_98_do = OrderLots() ;
  1394.                   Zi_97_in = OrderTicket() ;
  1395.                  }
  1396.                if(Zi_96_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_97_in)
  1397.                   continue;
  1398.                OrderOpenTime();
  1399.                OrderOpenPrice();
  1400.                Zi_98_do = OrderLots() ;
  1401.                Zi_97_in = OrderTicket() ;
  1402.               }
  1403.             if(Zi_95_st == "Order number")
  1404.               {
  1405.                Zi_100_do = Zi_97_in ;
  1406.               }
  1407.             else
  1408.               {
  1409.                if(Zi_95_st == "Lot")
  1410.                  {
  1411.                   Zi_100_do = Zi_98_do ;
  1412.                  }
  1413.                else
  1414.                  {
  1415.                   Zi_100_do = 0.0 ;
  1416.                  }
  1417.               }
  1418.             Zi_101_in = (int)Zi_100_do ;
  1419.             Zi_102_st = "Order number" ;
  1420.             Zi_103_st = "buy" ;
  1421.             Zi_104_in = 0 ;
  1422.             Zi_105_do = 0.0 ;
  1423.             for(Zi_106_in = OrdersTotal() - 1 ; Zi_106_in >= 0 ; Zi_106_in --)
  1424.               {
  1425.                if(!(OrderSelect(Zi_106_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1426.                   continue;
  1427.                if(Zi_103_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_104_in)
  1428.                  {
  1429.                   OrderOpenTime();
  1430.                   OrderOpenPrice();
  1431.                   Zi_105_do = OrderLots() ;
  1432.                   Zi_104_in = OrderTicket() ;
  1433.                  }
  1434.                if(Zi_103_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_104_in)
  1435.                   continue;
  1436.                OrderOpenTime();
  1437.                OrderOpenPrice();
  1438.                Zi_105_do = OrderLots() ;
  1439.                Zi_104_in = OrderTicket() ;
  1440.               }
  1441.             if(Zi_102_st == "Order number")
  1442.               {
  1443.                Zi_107_do = Zi_104_in ;
  1444.               }
  1445.             else
  1446.               {
  1447.                if(Zi_102_st == "Lot")
  1448.                  {
  1449.                   Zi_107_do = Zi_105_do ;
  1450.                  }
  1451.                else
  1452.                  {
  1453.                   Zi_107_do = 0.0 ;
  1454.                  }
  1455.               }
  1456.             if(OrderCloseBy((int)Zi_107_do, Zi_101_in, 0xFFFFFFFF))
  1457.               {
  1458.                do
  1459.                  {
  1460.                   Zi_108_st = "Order number" ;
  1461.                   Zi_109_st = "sell" ;
  1462.                   Zi_110_in = 0 ;
  1463.                   Zi_111_do = 0.0 ;
  1464.                   for(Zi_112_in = OrdersTotal() - 1 ; Zi_112_in >= 0 ; Zi_112_in --)
  1465.                     {
  1466.                      if(!(OrderSelect(Zi_112_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1467.                         continue;
  1468.                      if(Zi_109_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_110_in)
  1469.                        {
  1470.                         OrderOpenTime();
  1471.                         OrderOpenPrice();
  1472.                         Zi_111_do = OrderLots() ;
  1473.                         Zi_110_in = OrderTicket() ;
  1474.                        }
  1475.                      if(Zi_109_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_110_in)
  1476.                         continue;
  1477.                      OrderOpenTime();
  1478.                      OrderOpenPrice();
  1479.                      Zi_111_do = OrderLots() ;
  1480.                      Zi_110_in = OrderTicket() ;
  1481.                     }
  1482.                   if(Zi_108_st == "Order number")
  1483.                     {
  1484.                      Zi_113_do = Zi_110_in ;
  1485.                     }
  1486.                   else
  1487.                     {
  1488.                      if(Zi_108_st == "Lot")
  1489.                        {
  1490.                         Zi_113_do = Zi_111_do ;
  1491.                        }
  1492.                      else
  1493.                        {
  1494.                         Zi_113_do = 0.0 ;
  1495.                        }
  1496.                     }
  1497.                   Zi_114_in = (int)Zi_113_do ;
  1498.                   Zi_115_st = "Order number" ;
  1499.                   Zi_116_st = "buy" ;
  1500.                   Zi_117_in = 0 ;
  1501.                   Zi_118_do = 0.0 ;
  1502.                   for(Zi_119_in = OrdersTotal() - 1 ; Zi_119_in >= 0 ; Zi_119_in --)
  1503.                     {
  1504.                      if(!(OrderSelect(Zi_119_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1505.                         continue;
  1506.                      if(Zi_116_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_117_in)
  1507.                        {
  1508.                         OrderOpenTime();
  1509.                         OrderOpenPrice();
  1510.                         Zi_118_do = OrderLots() ;
  1511.                         Zi_117_in = OrderTicket() ;
  1512.                        }
  1513.                      if(Zi_116_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_117_in)
  1514.                         continue;
  1515.                      OrderOpenTime();
  1516.                      OrderOpenPrice();
  1517.                      Zi_118_do = OrderLots() ;
  1518.                      Zi_117_in = OrderTicket() ;
  1519.                     }
  1520.                   if(Zi_115_st == "Order number")
  1521.                     {
  1522.                      Zi_120_do = Zi_117_in ;
  1523.                     }
  1524.                   else
  1525.                     {
  1526.                      if(Zi_115_st == "Lot")
  1527.                        {
  1528.                         Zi_120_do = Zi_118_do ;
  1529.                        }
  1530.                      else
  1531.                        {
  1532.                         Zi_120_do = 0.0 ;
  1533.                        }
  1534.                     }
  1535.                  }
  1536.                while(OrderCloseBy((int)Zi_120_do, Zi_114_in, 0xFFFFFFFF));
  1537.               }
  1538.             lizong_14(0);
  1539.             if(NextTime >  0)
  1540.               {
  1541.                Zong_37_da_148 = GetSystemTime() + NextTime;
  1542.               }
  1543.             return(0);
  1544.            }
  1545.         }
  1546.       if(Zi_5_do + Zi_4_do >= CloseAll && (Zi_5_do <= MaxLossCloseAll || Zi_4_do <= MaxLossCloseAll))
  1547.         {
  1548.          Zi_121_st = "Order number" ;
  1549.          Zi_122_st = "sell" ;
  1550.          Zi_123_in = 0 ;
  1551.          Zi_124_do = 0.0 ;
  1552.          for(Zi_125_in = OrdersTotal() - 1 ; Zi_125_in >= 0 ; Zi_125_in --)
  1553.            {
  1554.             if(!(OrderSelect(Zi_125_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1555.                continue;
  1556.             if(Zi_122_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_123_in)
  1557.               {
  1558.                OrderOpenTime();
  1559.                OrderOpenPrice();
  1560.                Zi_124_do = OrderLots() ;
  1561.                Zi_123_in = OrderTicket() ;
  1562.               }
  1563.             if(Zi_122_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_123_in)
  1564.                continue;
  1565.             OrderOpenTime();
  1566.             OrderOpenPrice();
  1567.             Zi_124_do = OrderLots() ;
  1568.             Zi_123_in = OrderTicket() ;
  1569.            }
  1570.          if(Zi_121_st == "Order number")
  1571.            {
  1572.             Zi_126_do = Zi_123_in ;
  1573.            }
  1574.          else
  1575.            {
  1576.             if(Zi_121_st == "Lot")
  1577.               {
  1578.                Zi_126_do = Zi_124_do ;
  1579.               }
  1580.             else
  1581.               {
  1582.                Zi_126_do = 0.0 ;
  1583.               }
  1584.            }
  1585.          Zi_127_in = (int)Zi_126_do ;
  1586.          Zi_128_st = "Order number" ;
  1587.          Zi_129_st = "buy" ;
  1588.          Zi_130_in = 0 ;
  1589.          Zi_131_do = 0.0 ;
  1590.          for(Zi_132_in = OrdersTotal() - 1 ; Zi_132_in >= 0 ; Zi_132_in --)
  1591.            {
  1592.             if(!(OrderSelect(Zi_132_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1593.                continue;
  1594.             if(Zi_129_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_130_in)
  1595.               {
  1596.                OrderOpenTime();
  1597.                OrderOpenPrice();
  1598.                Zi_131_do = OrderLots() ;
  1599.                Zi_130_in = OrderTicket() ;
  1600.               }
  1601.             if(Zi_129_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_130_in)
  1602.                continue;
  1603.             OrderOpenTime();
  1604.             OrderOpenPrice();
  1605.             Zi_131_do = OrderLots() ;
  1606.             Zi_130_in = OrderTicket() ;
  1607.            }
  1608.          if(Zi_128_st == "Order number")
  1609.            {
  1610.             Zi_133_do = Zi_130_in ;
  1611.            }
  1612.          else
  1613.            {
  1614.             if(Zi_128_st == "Lot")
  1615.               {
  1616.                Zi_133_do = Zi_131_do ;
  1617.               }
  1618.             else
  1619.               {
  1620.                Zi_133_do = 0.0 ;
  1621.               }
  1622.            }
  1623.          if(OrderCloseBy((int)Zi_133_do, Zi_127_in, 0xFFFFFFFF))
  1624.            {
  1625.             do
  1626.               {
  1627.                Zi_134_st = "Order number" ;
  1628.                Zi_135_st = "sell" ;
  1629.                Zi_136_in = 0 ;
  1630.                Zi_137_do = 0.0 ;
  1631.                for(Zi_138_in = OrdersTotal() - 1 ; Zi_138_in >= 0 ; Zi_138_in --)
  1632.                  {
  1633.                   if(!(OrderSelect(Zi_138_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1634.                      continue;
  1635.                   if(Zi_135_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_136_in)
  1636.                     {
  1637.                      OrderOpenTime();
  1638.                      OrderOpenPrice();
  1639.                      Zi_137_do = OrderLots() ;
  1640.                      Zi_136_in = OrderTicket() ;
  1641.                     }
  1642.                   if(Zi_135_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_136_in)
  1643.                      continue;
  1644.                   OrderOpenTime();
  1645.                   OrderOpenPrice();
  1646.                   Zi_137_do = OrderLots() ;
  1647.                   Zi_136_in = OrderTicket() ;
  1648.                  }
  1649.                if(Zi_134_st == "Order number")
  1650.                  {
  1651.                   Zi_139_do = Zi_136_in ;
  1652.                  }
  1653.                else
  1654.                  {
  1655.                   if(Zi_134_st == "Lot")
  1656.                     {
  1657.                      Zi_139_do = Zi_137_do ;
  1658.                     }
  1659.                   else
  1660.                     {
  1661.                      Zi_139_do = 0.0 ;
  1662.                     }
  1663.                  }
  1664.                Zi_140_in = (int)Zi_139_do ;
  1665.                Zi_141_st = "Order number" ;
  1666.                Zi_142_st = "buy" ;
  1667.                Zi_143_in = 0 ;
  1668.                Zi_144_do = 0.0 ;
  1669.                for(Zi_145_in = OrdersTotal() - 1 ; Zi_145_in >= 0 ; Zi_145_in --)
  1670.                  {
  1671.                   if(!(OrderSelect(Zi_145_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  1672.                      continue;
  1673.                   if(Zi_142_st == "buy" && OrderType() == 0 && OrderTicket() >  Zi_143_in)
  1674.                     {
  1675.                      OrderOpenTime();
  1676.                      OrderOpenPrice();
  1677.                      Zi_144_do = OrderLots() ;
  1678.                      Zi_143_in = OrderTicket() ;
  1679.                     }
  1680.                   if(Zi_142_st != "sell" || OrderType() != 1 || OrderTicket() <= Zi_143_in)
  1681.                      continue;
  1682.                   OrderOpenTime();
  1683.                   OrderOpenPrice();
  1684.                   Zi_144_do = OrderLots() ;
  1685.                   Zi_143_in = OrderTicket() ;
  1686.                  }
  1687.                if(Zi_141_st == "Order number")
  1688.                  {
  1689.                   Zi_146_do = Zi_143_in ;
  1690.                  }
  1691.                else
  1692.                  {
  1693.                   if(Zi_141_st == "Lot")
  1694.                     {
  1695.                      Zi_146_do = Zi_144_do ;
  1696.                     }
  1697.                   else
  1698.                     {
  1699.                      Zi_146_do = 0.0 ;
  1700.                     }
  1701.                  }
  1702.               }
  1703.             while(OrderCloseBy((int)Zi_146_do, Zi_140_in, 0xFFFFFFFF));
  1704.            }
  1705.          lizong_14(0);
  1706.          if(NextTime >  0)
  1707.            {
  1708.             Zong_37_da_148 = GetSystemTime() + NextTime;
  1709.            }
  1710.          return(0);
  1711.         }
  1712.      }
  1713.    if(StopLoss != 0.0 && Zi_5_do + Zi_4_do <= StopLoss)
  1714.      {
  1715.       Print("Buy Loss ", Zi_5_do);
  1716.       Print("Sell Loss ", Zi_4_do);
  1717.       lizong_14(0);
  1718.       if(NextTime >  0)
  1719.         {
  1720.          Zong_37_da_148 = GetSystemTime() + NextTime;
  1721.         }
  1722.       return(0);
  1723.      }
  1724.    if(Zi_5_do <= MaxLoss)
  1725.      {
  1726.       Comment("Buy");
  1727.       ObjectSetText("Char.b", CharToString(225) + CharToString(251), Zong_33_in_134, "Wingdings", Red);
  1728.      }
  1729.    else
  1730.      {
  1731.       ObjectSetText("Char.b", CharToString(233), Zong_33_in_134, "Wingdings", Lime);
  1732.      }
  1733.    if(Zi_4_do <= MaxLoss)
  1734.      {
  1735.       Comment("Sell");
  1736.       ObjectSetText("Char.s", CharToString(226) + CharToString(251), Zong_33_in_134, "Wingdings", Red);
  1737.      }
  1738.    else
  1739.      {
  1740.       ObjectSetText("Char.s", CharToString(234), Zong_33_in_134, "Wingdings", Lime);
  1741.      }
  1742.    if(iOpen(Symbol(), PERIOD_M1, 0) > iOpen(Symbol(), PERIOD_M1, 1))
  1743.      {
  1744.       Zong_68_in_234 = Zong_66_in_22C ;
  1745.      }
  1746.    if(iOpen(Symbol(), PERIOD_M1, 0) < iOpen(Symbol(), PERIOD_M1, 1))
  1747.      {
  1748.       Zong_68_in_234 = Zong_67_in_230 ;
  1749.      }
  1750.    if(iClose(Symbol(), PERIOD_M1, 0) > iClose(Symbol(), PERIOD_M1, 1))
  1751.      {
  1752.       Zong_68_in_234 = Zong_70_in_23C ;
  1753.      }
  1754.    if(iClose(Symbol(), PERIOD_M1, 0) < iClose(Symbol(), PERIOD_M1, 1))
  1755.      {
  1756.       Zong_68_in_234 = Zong_71_in_240 ;
  1757.      }
  1758.    Zi_29_do = (Ask - Bid) / Point() ;
  1759.    Zi_30_st = Symbol() + ": " + DoubleToString(Zi_29_do, 1) + " Point" ;
  1760.    Zi_31_do = AccountLeverage() ;
  1761.    Zi_32_st = "lever: " + DoubleToString(Zi_31_do, 0) + " times" ;
  1762.    if(CloseBuySell == 1)
  1763.      {
  1764.       Zi_33_do = lizong_17(0, Magic, 1, Zong_56_in_1CC) - lizong_17(0, Magic, 2, Zong_57_in_1D0) ;
  1765.       if(Zong_51_do_198 < Zi_33_do)
  1766.         {
  1767.          Zong_51_do_198 = Zi_33_do ;
  1768.         }
  1769.       if(Zong_51_do_198 > 0.0 && Zi_33_do > 0.0 && Zong_51_do_198 > 0.0)
  1770.         {
  1771.          Zi_147_in = 1 ;
  1772.          Zi_148_in = Magic ;
  1773.          Zi_149_in = 0 ;
  1774.          Zi_150_do = 0.0 ;
  1775.          Zi_151_do = 0.0 ;
  1776.          for(Zi_152_in = OrdersTotal() - 1 ; Zi_152_in >= 0 ; Zi_152_in --)
  1777.            {
  1778.             if(!(OrderSelect(Zi_152_in, 0, 0)) || OrderSymbol() != Symbol())
  1779.                continue;
  1780.             if((OrderMagicNumber() != Zi_148_in && Zi_148_in != -1))
  1781.                continue;
  1782.             if((OrderType() != Zi_149_in && Zi_149_in != -100))
  1783.                continue;
  1784.             if(Zi_147_in == 1 && Zi_151_do < OrderProfit())
  1785.               {
  1786.                Zi_151_do = OrderProfit() ;
  1787.                Zi_150_do = OrderLots() ;
  1788.               }
  1789.             if(Zi_147_in != 2)
  1790.                continue;
  1791.             if((!(Zi_151_do > OrderProfit()) && !(Zi_151_do == 0.0)))
  1792.                continue;
  1793.             Zi_151_do = OrderProfit() ;
  1794.             Zi_150_do = OrderLots() ;
  1795.            }
  1796.          if(Zi_6_do > Zi_150_do * 3.0 + Zi_7_do && Zi_9_in >  3)
  1797.            {
  1798.             lizong_16(0, Magic, Zong_56_in_1CC, 1);
  1799.             lizong_16(0, Magic, Zong_57_in_1D0, 2);
  1800.             Zong_51_do_198 = 0.0 ;
  1801.             Zong_52_do_1A0 = 0.0 ;
  1802.            }
  1803.         }
  1804.       Zi_33_do = lizong_17(1, Magic, 1, Zong_56_in_1CC) - (lizong_17(1, Magic, 2, Zong_57_in_1D0)) ;
  1805.       if(Zong_52_do_1A0 < Zi_33_do)
  1806.         {
  1807.          Zong_52_do_1A0 = Zi_33_do ;
  1808.         }
  1809.       if(Zong_52_do_1A0 > 0.0 && Zi_33_do > 0.0 && Zong_52_do_1A0 > 0.0)
  1810.         {
  1811.          Zi_153_in = 1 ;
  1812.          Zi_154_in = Magic ;
  1813.          Zi_155_in = 1 ;
  1814.          Zi_156_do = 0.0 ;
  1815.          Zi_157_do = 0.0 ;
  1816.          for(Zi_158_in = OrdersTotal() - 1 ; Zi_158_in >= 0 ; Zi_158_in --)
  1817.            {
  1818.             if(!(OrderSelect(Zi_158_in, 0, 0)) || OrderSymbol() != Symbol())
  1819.                continue;
  1820.             if((OrderMagicNumber() != Zi_154_in && Zi_154_in != -1))
  1821.                continue;
  1822.             if((OrderType() != Zi_155_in && Zi_155_in != -100))
  1823.                continue;
  1824.             if(Zi_153_in == 1 && Zi_157_do < OrderProfit())
  1825.               {
  1826.                Zi_157_do = OrderProfit() ;
  1827.                Zi_156_do = OrderLots() ;
  1828.               }
  1829.             if(Zi_153_in != 2)
  1830.                continue;
  1831.             if((!(Zi_157_do > OrderProfit()) && !(Zi_157_do == 0.0)))
  1832.                continue;
  1833.             Zi_157_do = OrderProfit() ;
  1834.             Zi_156_do = OrderLots() ;
  1835.            }
  1836.          if(Zi_7_do > Zi_156_do * 3.0 + Zi_6_do && Zi_10_in >  3)
  1837.            {
  1838.             lizong_16(1, Magic, Zong_56_in_1CC, 1);
  1839.             lizong_16(1, Magic, Zong_57_in_1D0, 2);
  1840.             Zong_51_do_198 = 0.0 ;
  1841.             Zong_52_do_1A0 = 0.0 ;
  1842.            }
  1843.         }
  1844.      }
  1845.    if(((Money != 0.0 && Zi_40_do > Money) || Money == 0.0))
  1846.      {
  1847.       Zi_35_bo = true ;
  1848.      }
  1849.    if(Money != 0.0 && Zi_40_do <= Money)
  1850.      {
  1851.       Zi_35_bo = false ;
  1852.      }
  1853.    if(((OpenMode == 1 && Zong_90_da_2D8 != iTime(NULL, TimeZone, 0)) || OpenMode == 2 || OpenMode == 3))
  1854.      {
  1855.       if(Zi_11_in == 0 && Zi_5_do > MaxLoss && Zong_29_bo_128)
  1856.         {
  1857.          Zi_26_do=ReturnMethodPoints (OP_BUY,Zi_9_in,Zi_35_bo, Zi_17_do, DetectMethod);
  1858.          if(Zi_26_do!=0)
  1859.          if((Zi_9_in == 0 || (Zi_16_do != 0.0 && Zi_26_do >= NormalizeDouble(Step * Point() + Zi_16_do, Digits()) && Zong_39_bo_151 && Zi_35_bo) || (Zi_16_do != 0.0 && Zi_26_do >= NormalizeDouble(TwoStep * Point() + Zi_16_do, Digits()) && Zong_39_bo_151 && Zi_35_bo == false && Money != 0.0) || (Zi_17_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_17_do - Step * Point(), Digits()) && Zi_35_bo) || (Zi_17_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_17_do - TwoStep * Point(), Digits()) && Zi_35_bo == false && Money != 0.0) || (Homeopathy && Zi_16_do != 0.0 && Zi_26_do >= NormalizeDouble(Step * Point() + Zi_16_do, Digits()) && Zi_6_do == Zi_7_do)))
  1860.            {
  1861.             if(Zi_9_in == 0)
  1862.               {
  1863.                Zi_27_do = lot ;
  1864.               }
  1865.             else
  1866.               {
  1867.                Zi_27_do = NormalizeDouble(Zi_9_in * PlusLot + lot * (MathPow(K_Lot, Zi_9_in/2)), DigitsLot) ;
  1868.               }
  1869.             if(Zi_27_do > Maxlot)
  1870.               {
  1871.                Zi_27_do = Maxlot ;
  1872.               }
  1873.             if(((Zi_27_do * 2.0 < AccountFreeMargin() / MarketInfo(Symbol(), MODE_MARGINREQUIRED) && Zi_9_in > 0) || Zong_38_bo_150))
  1874.               {
  1875.                Zi_159_da = GetSystemTime();
  1876.                Zong_91_da_2E0 = StringToTime(StringConcatenate(TimeYear(Zi_159_da), ".", TimeMonth(Zi_159_da), ".", TimeDay(Zi_159_da), " ", EA_StartTime)) ;
  1877.                Zong_92_da_2E8 = StringToTime(StringConcatenate(TimeYear(Zi_159_da), ".", TimeMonth(Zi_159_da), ".", TimeDay(Zi_159_da), " ", EA_StopTime)) ;
  1878.                if(Zong_91_da_2E0 <  Zong_92_da_2E8 && (Zi_159_da < Zong_91_da_2E0 || Zi_159_da >  Zong_92_da_2E8))
  1879.                  {
  1880.                   Zi_160_bo = false ;
  1881.                  }
  1882.                else
  1883.                  {
  1884.                   if(Zong_91_da_2E0 >  Zong_92_da_2E8 && Zi_159_da <  Zong_91_da_2E0 && Zi_159_da >  Zong_92_da_2E8)
  1885.                     {
  1886.                      Zi_160_bo = false ;
  1887.                     }
  1888.                   else
  1889.                     {
  1890.                      Zi_160_bo = true ;
  1891.                     }
  1892.                  }
  1893.                Zi_161_da = 0 ;
  1894.                if(Zi_160_bo)
  1895.                  {
  1896.                   Zi_161_da = GetSystemTime();
  1897.                   Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_161_da), ".", TimeMonth(Zi_161_da), ".", TimeDay(Zi_161_da), " ", Limit_StartTime)) ;
  1898.                   Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_161_da), ".", TimeMonth(Zi_161_da), ".", TimeDay(Zi_161_da), " ", Limit_StopTime)) ;
  1899.                   if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_161_da < Zong_91_da_2E0 || Zi_161_da >  Zong_94_da_2F8))
  1900.                     {
  1901.                      ObjectDelete("HLINE_LONG");
  1902.                      ObjectDelete("HLINE_SHORT");
  1903.                      ObjectDelete("HLINE_LONGII");
  1904.                      ObjectDelete("HLINE_SHORTII");
  1905.                      Zi_162_bo = false ;
  1906.                     }
  1907.                   else
  1908.                     {
  1909.                      if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_161_da <  Zong_93_da_2F0 && Zi_161_da >  Zong_94_da_2F8)
  1910.                        {
  1911.                         ObjectDelete("HLINE_LONG");
  1912.                         ObjectDelete("HLINE_SHORT");
  1913.                         ObjectDelete("HLINE_LONGII");
  1914.                         ObjectDelete("HLINE_SHORTII");
  1915.                         Zi_162_bo = false ;
  1916.                        }
  1917.                      else
  1918.                        {
  1919.                         Zi_162_bo = true ;
  1920.                        }
  1921.                     }
  1922.                   Zi_163_da = GetSystemTime();
  1923.                   Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_163_da), ".", TimeMonth(Zi_163_da), ".", TimeDay(Zi_163_da), " ", Limit_StartTime)) ;
  1924.                   Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_163_da), ".", TimeMonth(Zi_163_da), ".", TimeDay(Zi_163_da), " ", Limit_StopTime)) ;
  1925.                   if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_163_da < Zong_91_da_2E0 || Zi_163_da >  Zong_94_da_2F8))
  1926.                     {
  1927.                      ObjectDelete("HLINE_LONG");
  1928.                      ObjectDelete("HLINE_SHORT");
  1929.                      ObjectDelete("HLINE_LONGII");
  1930.                      ObjectDelete("HLINE_SHORTII");
  1931.                      Zi_164_bo = false ;
  1932.                     }
  1933.                   else
  1934.                     {
  1935.                      if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_163_da <  Zong_93_da_2F0 && Zi_163_da >  Zong_94_da_2F8)
  1936.                        {
  1937.                         ObjectDelete("HLINE_LONG");
  1938.                         ObjectDelete("HLINE_SHORT");
  1939.                         ObjectDelete("HLINE_LONGII");
  1940.                         ObjectDelete("HLINE_SHORTII");
  1941.                         Zi_164_bo = false ;
  1942.                        }
  1943.                      else
  1944.                        {
  1945.                         Zi_164_bo = true ;
  1946.                        }
  1947.                     }
  1948.                   if(!(Zi_164_bo))
  1949.                     {
  1950.                      Zi_165_da = GetSystemTime();
  1951.                      Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_165_da), ".", TimeMonth(Zi_165_da), ".", TimeDay(Zi_165_da), " ", Limit_StartTime)) ;
  1952.                      Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_165_da), ".", TimeMonth(Zi_165_da), ".", TimeDay(Zi_165_da), " ", Limit_StopTime)) ;
  1953.                      if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_165_da < Zong_91_da_2E0 || Zi_165_da >  Zong_94_da_2F8))
  1954.                        {
  1955.                         ObjectDelete("HLINE_LONG");
  1956.                         ObjectDelete("HLINE_SHORT");
  1957.                         ObjectDelete("HLINE_LONGII");
  1958.                         ObjectDelete("HLINE_SHORTII");
  1959.                         Zi_166_bo = false ;
  1960.                        }
  1961.                      else
  1962.                        {
  1963.                         if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_165_da <  Zong_93_da_2F0 && Zi_165_da >  Zong_94_da_2F8)
  1964.                           {
  1965.                            ObjectDelete("HLINE_LONG");
  1966.                            ObjectDelete("HLINE_SHORT");
  1967.                            ObjectDelete("HLINE_LONGII");
  1968.                            ObjectDelete("HLINE_SHORTII");
  1969.                            Zi_166_bo = false ;
  1970.                           }
  1971.                         else
  1972.                           {
  1973.                            Zi_166_bo = true ;
  1974.                           }
  1975.                        }
  1976.                      Zi_167_da = GetSystemTime();
  1977.                      Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_167_da), ".", TimeMonth(Zi_167_da), ".", TimeDay(Zi_167_da), " ", Limit_StartTime)) ;
  1978.                      Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_167_da), ".", TimeMonth(Zi_167_da), ".", TimeDay(Zi_167_da), " ", Limit_StopTime)) ;
  1979.                      if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_167_da < Zong_91_da_2E0 || Zi_167_da >  Zong_94_da_2F8))
  1980.                        {
  1981.                         ObjectDelete("HLINE_LONG");
  1982.                         ObjectDelete("HLINE_SHORT");
  1983.                         ObjectDelete("HLINE_LONGII");
  1984.                         ObjectDelete("HLINE_SHORTII");
  1985.                         Zi_168_bo = false ;
  1986.                        }
  1987.                      else
  1988.                        {
  1989.                         if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_167_da <  Zong_93_da_2F0 && Zi_167_da >  Zong_94_da_2F8)
  1990.                           {
  1991.                            ObjectDelete("HLINE_LONG");
  1992.                            ObjectDelete("HLINE_SHORT");
  1993.                            ObjectDelete("HLINE_LONGII");
  1994.                            ObjectDelete("HLINE_SHORTII");
  1995.                            Zi_168_bo = false ;
  1996.                           }
  1997.                         else
  1998.                           {
  1999.                            Zi_168_bo = true ;
  2000.                           }
  2001.                        }
  2002.                      Zi_169_da = GetSystemTime() ;
  2003.                      Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_169_da), ".", TimeMonth(Zi_169_da), ".", TimeDay(Zi_169_da), " ", Limit_StartTime)) ;
  2004.                      Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_169_da), ".", TimeMonth(Zi_169_da), ".", TimeDay(Zi_169_da), " ", Limit_StopTime)) ;
  2005.                      if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_169_da < Zong_91_da_2E0 || Zi_169_da >  Zong_94_da_2F8))
  2006.                        {
  2007.                         ObjectDelete("HLINE_LONG");
  2008.                         ObjectDelete("HLINE_SHORT");
  2009.                         ObjectDelete("HLINE_LONGII");
  2010.                         ObjectDelete("HLINE_SHORTII");
  2011.                         Zi_170_bo = false ;
  2012.                        }
  2013.                      else
  2014.                        {
  2015.                         if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_169_da <  Zong_93_da_2F0 && Zi_169_da >  Zong_94_da_2F8)
  2016.                           {
  2017.                            ObjectDelete("HLINE_LONG");
  2018.                            ObjectDelete("HLINE_SHORT");
  2019.                            ObjectDelete("HLINE_LONGII");
  2020.                            ObjectDelete("HLINE_SHORTII");
  2021.                            Zi_170_bo = false ;
  2022.                           }
  2023.                         else
  2024.                           {
  2025.                            Zi_170_bo = true ;
  2026.                           }
  2027.                        }
  2028.                     }
  2029.                   if((On_top_of_this_price_not_Buy_order == 0.0 || (Zi_168_bo && Zi_9_in >= 1 && Zi_26_do < On_top_of_this_price_not_Buy_order) || Zi_9_in == 0 || !(Zi_170_bo)))
  2030.                     {
  2031.                      Zi_171_in = 0 ;
  2032.                      Zi_172_in = Magic ;
  2033.                      Zi_173_da = 0 ;
  2034.                      Zi_174_in = 0 ;
  2035.                      for(Zi_175_in = OrdersTotal() - 1 ; Zi_175_in >= 0 ; Zi_175_in --)
  2036.                        {
  2037.                         if(!(OrderSelect(Zi_175_in, 0, 0)) || Symbol() != OrderSymbol() || OrderMagicNumber() != Zi_172_in || OrderTicket() <= Zi_174_in || OrderType() != Zi_171_in)
  2038.                            continue;
  2039.                         Zi_174_in = OrderTicket() ;
  2040.                         Zi_173_da = OrderOpenTime() ;
  2041.                        }
  2042.                      if(((GetSystemTime() - Zi_173_da >= sleep && OpenMode == 2) || OpenMode == 3 || OpenMode == 1))
  2043.                        {
  2044.                         if(((Zi_16_do != 0.0 && Zi_26_do >= NormalizeDouble(Step * Point() + Zi_16_do, Digits()) && Zong_39_bo_151 && Zi_35_bo) || (Zi_16_do != 0.0 && Zi_26_do >= NormalizeDouble(TwoStep * Point() + Zi_16_do, Digits()) && Zong_39_bo_151 && Zi_35_bo == false && Money != 0.0) || (Homeopathy && Zi_16_do != 0.0 && Zi_26_do >= NormalizeDouble(Step * Point() + Zi_16_do, Digits()) && Zi_6_do == Zi_7_do)))
  2045.                           {
  2046.                            Zong_97_in_310 = OrderSend(Symbol(), 4, Zi_27_do, Zi_26_do, Zong_50_in_190, 0.0, 0.0, Zong_12_st_B0, Magic, 0, Blue) ;     //BUY Stop
  2047.                            if(Zong_97_in_310 >  0)
  2048.                              {
  2049.                               Print(Symbol() + " Order successfully processed, order number:" + DoubleToString(Zong_97_in_310, 0));
  2050.                              }
  2051.                            else
  2052.                              {
  2053.                               Print(Symbol() + " Buy Order failed " + string(GetLastError()));
  2054.                              }
  2055.                           }
  2056.                         else
  2057.                           {
  2058.                            Zong_97_in_310 = OrderSend(Symbol(), 4, Zi_27_do, Zi_26_do, Zong_50_in_190, 0.0, 0.0, Zong_11_st_A0, Magic, 0, Blue) ;     //BUY Stop
  2059.                            if(Zong_97_in_310 >  0)
  2060.                              {
  2061.                               Print(Symbol() + " Order successfully processed, order number:" + DoubleToString(Zong_97_in_310, 0));
  2062.                              }
  2063.                            else
  2064.                              {
  2065.                               Print(Symbol() + " Buy Order failed " + string(GetLastError()));
  2066.                              }
  2067.                           }
  2068.                        }
  2069.                     }
  2070.                  }
  2071.               }
  2072.             else
  2073.               {
  2074.                Comment("Lot ", DoubleToString(Zi_27_do, 2));
  2075.               }
  2076.            }
  2077.         }
  2078.       if((Zi_12_in == 0 && Zi_4_do > MaxLoss && Zong_30_bo_129))
  2079.         {
  2080.            Zi_26_do=ReturnMethodPoints (OP_SELL,Zi_10_in,Zi_35_bo, Zi_18_do, DetectMethod);
  2081.          if(Zi_26_do!=0)
  2082.          if((Zi_10_in == 0 || (Zi_19_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_19_do - Step * Point(), Digits()) && Zong_40_bo_152 && Zi_35_bo) || (Zi_19_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_19_do - TwoStep * Point(), Digits()) && Zong_40_bo_152 && Zi_35_bo == false && Money != 0.0) || (Zi_18_do != 0.0 && Zi_26_do >= NormalizeDouble(Step * Point() + Zi_18_do, Digits()) && Zi_35_bo) || (Zi_18_do != 0.0 && Zi_26_do >= NormalizeDouble(TwoStep * Point() + Zi_18_do, Digits()) && Zi_35_bo == false && Money != 0.0) || (Homeopathy && Zi_19_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_19_do - Step * Point(), Digits()) && Zi_6_do == Zi_7_do)))
  2083.            {
  2084.             if(Zi_10_in == 0)
  2085.               {
  2086.                Zi_27_do = lot ;
  2087.               }
  2088.             else
  2089.               {
  2090.                Zi_27_do = NormalizeDouble(Zi_10_in * PlusLot + lot * (MathPow(K_Lot, Zi_10_in/2)), DigitsLot) ;
  2091.               }
  2092.             if(Zi_27_do > Maxlot)
  2093.               {
  2094.                Zi_27_do = Maxlot ;
  2095.               }
  2096.             if(((Zi_27_do * 2.0 < AccountFreeMargin() / MarketInfo(Symbol(), MODE_MARGINREQUIRED) && Zi_10_in > 0) || Zong_38_bo_150))
  2097.               {
  2098.                Zi_176_da = GetSystemTime() ;
  2099.                Zong_91_da_2E0 = StringToTime(StringConcatenate(TimeYear(Zi_176_da), ".", TimeMonth(Zi_176_da), ".", TimeDay(Zi_176_da), " ", EA_StartTime)) ;
  2100.                Zong_92_da_2E8 = StringToTime(StringConcatenate(TimeYear(Zi_176_da), ".", TimeMonth(Zi_176_da), ".", TimeDay(Zi_176_da), " ", EA_StopTime)) ;
  2101.                if(Zong_91_da_2E0 <  Zong_92_da_2E8 && (Zi_176_da < Zong_91_da_2E0 || Zi_176_da >  Zong_92_da_2E8))
  2102.                  {
  2103.                   Zi_177_bo = false ;
  2104.                  }
  2105.                else
  2106.                  {
  2107.                   if(Zong_91_da_2E0 >  Zong_92_da_2E8 && Zi_176_da <  Zong_91_da_2E0 && Zi_176_da >  Zong_92_da_2E8)
  2108.                     {
  2109.                      Zi_177_bo = false ;
  2110.                     }
  2111.                   else
  2112.                     {
  2113.                      Zi_177_bo = true ;
  2114.                     }
  2115.                  }
  2116.                Zi_178_da = 0 ;
  2117.                if(Zi_177_bo)
  2118.                  {
  2119.                   Zi_178_da = GetSystemTime() ;
  2120.                   Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_178_da), ".", TimeMonth(Zi_178_da), ".", TimeDay(Zi_178_da), " ", Limit_StartTime)) ;
  2121.                   Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_178_da), ".", TimeMonth(Zi_178_da), ".", TimeDay(Zi_178_da), " ", Limit_StopTime)) ;
  2122.                   if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_178_da < Zong_91_da_2E0 || Zi_178_da >  Zong_94_da_2F8))
  2123.                     {
  2124.                      ObjectDelete("HLINE_LONG");
  2125.                      ObjectDelete("HLINE_SHORT");
  2126.                      ObjectDelete("HLINE_LONGII");
  2127.                      ObjectDelete("HLINE_SHORTII");
  2128.                      Zi_179_bo = false ;
  2129.                     }
  2130.                   else
  2131.                     {
  2132.                      if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_178_da <  Zong_93_da_2F0 && Zi_178_da >  Zong_94_da_2F8)
  2133.                        {
  2134.                         ObjectDelete("HLINE_LONG");
  2135.                         ObjectDelete("HLINE_SHORT");
  2136.                         ObjectDelete("HLINE_LONGII");
  2137.                         ObjectDelete("HLINE_SHORTII");
  2138.                         Zi_179_bo = false ;
  2139.                        }
  2140.                      else
  2141.                        {
  2142.                         Zi_179_bo = true ;
  2143.                        }
  2144.                     }
  2145.                   Zi_180_da = GetSystemTime() ;
  2146.                   Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_180_da), ".", TimeMonth(Zi_180_da), ".", TimeDay(Zi_180_da), " ", Limit_StartTime)) ;
  2147.                   Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_180_da), ".", TimeMonth(Zi_180_da), ".", TimeDay(Zi_180_da), " ", Limit_StopTime)) ;
  2148.                   if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_180_da < Zong_91_da_2E0 || Zi_180_da >  Zong_94_da_2F8))
  2149.                     {
  2150.                      ObjectDelete("HLINE_LONG");
  2151.                      ObjectDelete("HLINE_SHORT");
  2152.                      ObjectDelete("HLINE_LONGII");
  2153.                      ObjectDelete("HLINE_SHORTII");
  2154.                      Zi_181_bo = false ;
  2155.                     }
  2156.                   else
  2157.                     {
  2158.                      if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_180_da <  Zong_93_da_2F0 && Zi_180_da >  Zong_94_da_2F8)
  2159.                        {
  2160.                         ObjectDelete("HLINE_LONG");
  2161.                         ObjectDelete("HLINE_SHORT");
  2162.                         ObjectDelete("HLINE_LONGII");
  2163.                         ObjectDelete("HLINE_SHORTII");
  2164.                         Zi_181_bo = false ;
  2165.                        }
  2166.                      else
  2167.                        {
  2168.                         Zi_181_bo = true ;
  2169.                        }
  2170.                     }
  2171.                   if(!(Zi_181_bo))
  2172.                     {
  2173.                      Zi_182_da = GetSystemTime() ;
  2174.                      Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_182_da), ".", TimeMonth(Zi_182_da), ".", TimeDay(Zi_182_da), " ", Limit_StartTime)) ;
  2175.                      Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_182_da), ".", TimeMonth(Zi_182_da), ".", TimeDay(Zi_182_da), " ", Limit_StopTime)) ;
  2176.                      if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_182_da < Zong_91_da_2E0 || Zi_182_da >  Zong_94_da_2F8))
  2177.                        {
  2178.                         ObjectDelete("HLINE_LONG");
  2179.                         ObjectDelete("HLINE_SHORT");
  2180.                         ObjectDelete("HLINE_LONGII");
  2181.                         ObjectDelete("HLINE_SHORTII");
  2182.                         Zi_183_bo = false ;
  2183.                        }
  2184.                      else
  2185.                        {
  2186.                         if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_182_da <  Zong_93_da_2F0 && Zi_182_da >  Zong_94_da_2F8)
  2187.                           {
  2188.                            ObjectDelete("HLINE_LONG");
  2189.                            ObjectDelete("HLINE_SHORT");
  2190.                            ObjectDelete("HLINE_LONGII");
  2191.                            ObjectDelete("HLINE_SHORTII");
  2192.                            Zi_183_bo = false ;
  2193.                           }
  2194.                         else
  2195.                           {
  2196.                            Zi_183_bo = true ;
  2197.                           }
  2198.                        }
  2199.                      Zi_184_da = GetSystemTime();                     
  2200.                      Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_184_da), ".", TimeMonth(Zi_184_da), ".", TimeDay(Zi_184_da), " ", Limit_StartTime)) ;
  2201.                      Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_184_da), ".", TimeMonth(Zi_184_da), ".", TimeDay(Zi_184_da), " ", Limit_StopTime)) ;
  2202.                      if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_184_da < Zong_91_da_2E0 || Zi_184_da >  Zong_94_da_2F8))
  2203.                        {
  2204.                         ObjectDelete("HLINE_LONG");
  2205.                         ObjectDelete("HLINE_SHORT");
  2206.                         ObjectDelete("HLINE_LONGII");
  2207.                         ObjectDelete("HLINE_SHORTII");
  2208.                         Zi_185_bo = false ;
  2209.                        }
  2210.                      else
  2211.                        {
  2212.                         if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_184_da <  Zong_93_da_2F0 && Zi_184_da >  Zong_94_da_2F8)
  2213.                           {
  2214.                            ObjectDelete("HLINE_LONG");
  2215.                            ObjectDelete("HLINE_SHORT");
  2216.                            ObjectDelete("HLINE_LONGII");
  2217.                            ObjectDelete("HLINE_SHORTII");
  2218.                            Zi_185_bo = false ;
  2219.                           }
  2220.                         else
  2221.                           {
  2222.                            Zi_185_bo = true ;
  2223.                           }
  2224.                        }
  2225.                      Zi_186_da = GetSystemTime();
  2226.                      Zong_93_da_2F0 = StringToTime(StringConcatenate(TimeYear(Zi_186_da), ".", TimeMonth(Zi_186_da), ".", TimeDay(Zi_186_da), " ", Limit_StartTime)) ;
  2227.                      Zong_94_da_2F8 = StringToTime(StringConcatenate(TimeYear(Zi_186_da), ".", TimeMonth(Zi_186_da), ".", TimeDay(Zi_186_da), " ", Limit_StopTime)) ;
  2228.                      if(Zong_93_da_2F0 <  Zong_94_da_2F8 && (Zi_186_da < Zong_91_da_2E0 || Zi_186_da >  Zong_94_da_2F8))
  2229.                        {
  2230.                         ObjectDelete("HLINE_LONG");
  2231.                         ObjectDelete("HLINE_SHORT");
  2232.                         ObjectDelete("HLINE_LONGII");
  2233.                         ObjectDelete("HLINE_SHORTII");
  2234.                         Zi_187_bo = false ;
  2235.                        }
  2236.                      else
  2237.                        {
  2238.                         if(Zong_93_da_2F0 >  Zong_94_da_2F8 && Zi_186_da <  Zong_93_da_2F0 && Zi_186_da >  Zong_94_da_2F8)
  2239.                           {
  2240.                            ObjectDelete("HLINE_LONG");
  2241.                            ObjectDelete("HLINE_SHORT");
  2242.                            ObjectDelete("HLINE_LONGII");
  2243.                            ObjectDelete("HLINE_SHORTII");
  2244.                            Zi_187_bo = false ;
  2245.                           }
  2246.                         else
  2247.                           {
  2248.                            Zi_187_bo = true ;
  2249.                           }
  2250.                        }
  2251.                     }
  2252.                   if((On_under_of_this_price_not_Sell_order == 0.0 || (Zi_185_bo && Zi_10_in >= 1 && Zi_26_do > On_under_of_this_price_not_Sell_order) || Zi_10_in == 0 || !(Zi_187_bo)))
  2253.                     {
  2254.                      Zi_188_in = 1 ;
  2255.                      Zi_189_in = Magic ;
  2256.                      Zi_190_da = 0 ;
  2257.                      Zi_191_in = 0 ;
  2258.                      for(Zi_192_in = OrdersTotal() - 1 ; Zi_192_in >= 0 ; Zi_192_in --)
  2259.                        {
  2260.                         if(!(OrderSelect(Zi_192_in, 0, 0)) || Symbol() != OrderSymbol() || OrderMagicNumber() != Zi_189_in || OrderTicket() <= Zi_191_in || OrderType() != Zi_188_in)
  2261.                            continue;
  2262.                         Zi_191_in = OrderTicket() ;
  2263.                         Zi_190_da = OrderOpenTime() ;
  2264.                        }
  2265.                      if(((GetSystemTime() - Zi_190_da >= sleep && OpenMode == 2) || OpenMode == 3 || OpenMode == 1))
  2266.                        {
  2267.                         if(((Zi_19_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_19_do - Step * Point(), Digits()) && Zong_40_bo_152 && Zi_35_bo) || (Zi_19_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_19_do - TwoStep * Point(), Digits()) && Zong_40_bo_152 && Zi_35_bo == false && Money != 0.0) || (Homeopathy && Zi_19_do != 0.0 && Zi_26_do <= NormalizeDouble(Zi_19_do - Step * Point(), Digits()) && Zi_6_do == Zi_7_do)))
  2268.                           {
  2269.                            Zong_97_in_310 = OrderSend(Symbol(), 5, Zi_27_do, Zi_26_do, Zong_50_in_190, 0.0, 0.0, Zong_12_st_B0, Magic, 0, Red) ;   //SELL Stop
  2270.                            if(Zong_97_in_310 >  0)
  2271.                              {
  2272.                               Print(Symbol() + " Order successfully processed, order number:" + DoubleToString(Zong_97_in_310, 0));
  2273.                              }
  2274.                            else
  2275.                              {
  2276.                               Print(Symbol() + " Sell Order failed " + string(GetLastError()));
  2277.                              }
  2278.                           }
  2279.                         else
  2280.                           {
  2281.                            Zong_97_in_310 = OrderSend(Symbol(), 5, Zi_27_do, Zi_26_do, Zong_50_in_190, 0.0, 0.0, Zong_11_st_A0, Magic, 0, Red) ;   //SELL Stop
  2282.                            if(Zong_97_in_310 >  0)
  2283.                              {
  2284.                               Print(Symbol() + "Order successfully processed, order number:" + DoubleToString(Zong_97_in_310, 0));
  2285.                              }
  2286.                            else
  2287.                              {
  2288.                               Print(Symbol() + " Sell Order failed " + string(GetLastError()));
  2289.                              }
  2290.                           }
  2291.                        }
  2292.                     }
  2293.                  }
  2294.               }
  2295.             else
  2296.               {
  2297.                Comment("Lot ", DoubleToString(Zi_27_do, 2));
  2298.               }
  2299.            }
  2300.         }
  2301.       Zong_90_da_2D8 = iTime(NULL, TimeZone, 0) ;
  2302.      }
  2303.    Zi_34_do = Zi_5_do + Zi_4_do ;
  2304.    if(Zi_6_do > 0.0)
  2305.      {
  2306.       if(Zi_5_do > 0.0)
  2307.         {
  2308.          Zi_193_co = 255 ;
  2309.         }
  2310.       else
  2311.         {
  2312.          Zi_193_co = 65280 ;
  2313.         }
  2314.       ObjectSetText("ProfitB", StringConcatenate("Buy ", Zi_9_in, "Lot , ", DoubleToString(Zi_6_do, 2), "Lot,  Profit= ", DoubleToString(Zi_5_do, 2)), Zong_33_in_134, "Arial", Zi_193_co);
  2315.      }
  2316.    else
  2317.      {
  2318.       ObjectSetText("ProfitB", "", Zong_33_in_134, "Arial", Gray);
  2319.      }
  2320.    if(Zi_7_do > 0.0)
  2321.      {
  2322.       if(Zi_4_do > 0.0)
  2323.         {
  2324.          Zi_194_co = 255 ;
  2325.         }
  2326.       else
  2327.         {
  2328.          Zi_194_co = 65280 ;
  2329.         }
  2330.       ObjectSetText("ProfitS", StringConcatenate("Sell ", Zi_10_in, "Lot , ", DoubleToString(Zi_7_do, 2), "Lot,  Profit= ", DoubleToString(Zi_4_do, 2)), Zong_33_in_134, "Arial", Zi_194_co);
  2331.      }
  2332.    else
  2333.      {
  2334.       ObjectSetText("ProfitS", "", Zong_33_in_134, "Arial", Gray);
  2335.      }
  2336.    if(Zi_7_do + Zi_6_do > 0.0)
  2337.      {
  2338.       if(Zi_34_do > 0.0)
  2339.         {
  2340.          Zi_195_co = 255 ;
  2341.         }
  2342.       else
  2343.         {
  2344.          Zi_195_co = 65280 ;
  2345.         }
  2346.       ObjectSetText("Profit", StringConcatenate("Total Profit= ", DoubleToString(Zi_34_do, 2)), Zong_33_in_134, "Arial", Zi_195_co);
  2347.      }
  2348.    else
  2349.      {
  2350.       ObjectSetText("Profit", "", Zong_33_in_134, "Arial", White);
  2351.      }
  2352.    if(Zi_20_do != 0.0 && Zong_29_bo_128)
  2353.      {
  2354.       if(Zi_9_in == 0)
  2355.         {
  2356.          Zi_26_do = NormalizeDouble(FirstStep * Point() + Ask, Digits()) ;
  2357.         }
  2358.       if(Zi_35_bo && Zi_9_in >  0)
  2359.         {
  2360.          Zi_26_do = NormalizeDouble(MinDistance * Point() + Ask, Digits()) ;
  2361.         }
  2362.       if(Zi_35_bo == false && Zi_9_in >  0 && Money != 0.0)
  2363.         {
  2364.          Zi_26_do = NormalizeDouble(TwoMinDistance * Point() + Ask, Digits()) ;
  2365.         }
  2366.       if(NormalizeDouble(Zi_20_do - StepTrallOrders * Point(), Digits()) > Zi_26_do && (((Zi_26_do <= NormalizeDouble(Zi_17_do - Step * Point(), Digits()) || Zi_17_do == 0.0 || (Zong_39_bo_151 && Zi_9_in == 0) || Zi_26_do >= NormalizeDouble(Step * Point() + Zi_16_do, Digits()) || Zi_26_do <= NormalizeDouble(Zi_17_do - Step * Point(), Digits())) && Zi_35_bo) || ((Zi_26_do <= NormalizeDouble(Zi_17_do - TwoStep * Point(), Digits()) || Zi_17_do == 0.0 || (Zong_39_bo_151 && Zi_9_in == 0) || Zi_26_do >= NormalizeDouble(TwoStep * Point() + Zi_16_do, Digits()) || Zi_26_do <= NormalizeDouble(Zi_17_do - TwoStep * Point(), Digits())) && Zi_35_bo == false && Money != 0.0)))
  2367.         {
  2368.          if(!(OrderModify(Zi_14_in, Zi_26_do, 0.0, 0.0, 0, White)))
  2369.            {
  2370.             Print("Error ", GetLastError(), "   Order Modify Buy   OOP ", Zi_20_do, "->", Zi_26_do);
  2371.            }
  2372.          else
  2373.            {
  2374.             Print("Order Buy Modify   OOP ", Zi_3_do, "->", Zi_26_do);
  2375.            }
  2376.         }
  2377.      }
  2378.    if(Zi_21_do != 0.0 && Zong_30_bo_129)
  2379.      {
  2380.       if(Zi_10_in == 0)
  2381.         {
  2382.          Zi_26_do = NormalizeDouble(Bid - FirstStep * Point(), Digits()) ;
  2383.         }
  2384.       if(Zi_35_bo && Zi_10_in >  0)
  2385.         {
  2386.          Zi_26_do = NormalizeDouble(Bid - MinDistance * Point(), Digits()) ;
  2387.         }
  2388.       if(Zi_35_bo == false && Zi_10_in >  0 && Money != 0.0)
  2389.         {
  2390.          Zi_26_do = NormalizeDouble(Bid - TwoMinDistance * Point(), Digits()) ;
  2391.         }
  2392.       if(NormalizeDouble(StepTrallOrders * Point() + Zi_21_do, Digits()) < Zi_26_do && (((Zi_26_do >= NormalizeDouble(Step * Point() + Zi_18_do, Digits()) || Zi_18_do == 0.0 || (Zong_40_bo_152 && Zi_10_in == 0) || Zi_26_do <= NormalizeDouble(Zi_19_do - Step * Point(), Digits()) || Zi_26_do >= NormalizeDouble(Step * Point() + Zi_18_do, Digits())) && Zi_35_bo) || ((Zi_26_do >= NormalizeDouble(TwoStep * Point() + Zi_18_do, Digits()) || Zi_18_do == 0.0 || (Zong_40_bo_152 && Zi_10_in == 0) || Zi_26_do <= NormalizeDouble(Zi_19_do - TwoStep * Point(), Digits()) || Zi_26_do >= NormalizeDouble(TwoStep * Point() + Zi_18_do, Digits())) && Zi_35_bo == false && Money != 0.0)))
  2393.         {
  2394.          if(!(OrderModify(Zi_15_in, Zi_26_do, 0.0, 0.0, 0, White)))
  2395.            {
  2396.             Print("Error ", GetLastError(), "   Order Modify Sell   OOP ", Zi_21_do, "->", Zi_26_do);
  2397.            }
  2398.          else
  2399.            {
  2400.             Print("Order Sell Modify   OOP ", Zi_3_do, "->", Zi_26_do);
  2401.            }
  2402.         }
  2403.      }
  2404.    lizong_20();
  2405.    return(0);
  2406.   }
  2407. //1-Candle  2-Fractals  3-pips";  
  2408. double ReturnMethodPoints (int typeTrade,int no_of_trade,bool TwoMin, double lastOpenPrice, double MethodUse)
  2409. {
  2410.    double    RetVal=0;
  2411.    int       i;
  2412.    if (MethodUse==3)
  2413.    {
  2414.       if (typeTrade==OP_BUY)
  2415.       {
  2416.          if(no_of_trade==0)
  2417.          RetVal= NormalizeDouble(FirstStep * Point() + Ask, Digits()) ;
  2418.          else
  2419.          {
  2420.             if(TwoMin)
  2421.             {
  2422.                RetVal  = NormalizeDouble(MinDistance * Point() + Ask, Digits()) ;
  2423.             }
  2424.             if(TwoMin == false && Money != 0.0)
  2425.             {
  2426.                RetVal = NormalizeDouble(TwoMinDistance * Point() + Ask, Digits()) ;
  2427.             }
  2428.             if(RetVal < NormalizeDouble(lastOpenPrice - Step * Point(), Digits()) && TwoMin)
  2429.             {
  2430.                RetVal = NormalizeDouble(Step * Point() + Ask, Digits()) ;
  2431.             }
  2432.             if(RetVal < NormalizeDouble(lastOpenPrice - TwoStep * Point(), Digits()) && TwoMin == false && Money != 0.0)
  2433.             {
  2434.                RetVal = NormalizeDouble(TwoStep * Point() + Ask, Digits()) ;
  2435.             }
  2436.          }
  2437.       }
  2438.       else
  2439.       {
  2440.          if(no_of_trade==0)
  2441.          {
  2442.             RetVal = NormalizeDouble(Bid - FirstStep * Point(), Digits()) ;
  2443.          }
  2444.          else
  2445.          {
  2446.             if(TwoMin)
  2447.             {
  2448.                RetVal = NormalizeDouble(Bid - MinDistance * Point(), Digits()) ;
  2449.             }
  2450.             if(TwoMin == false)
  2451.             {
  2452.                RetVal = NormalizeDouble(Bid - TwoMinDistance * Point(), Digits()) ;
  2453.             }
  2454.             if(RetVal < NormalizeDouble(Step * Point() + lastOpenPrice, Digits()) && TwoMin)
  2455.             {
  2456.                RetVal = NormalizeDouble(Bid - Step * Point(), Digits()) ;
  2457.             }
  2458.             if(RetVal < NormalizeDouble(TwoStep * Point() + lastOpenPrice, Digits()) && TwoMin == false && Money != 0.0)
  2459.             {
  2460.                RetVal = NormalizeDouble(Bid - TwoStep * Point(), Digits()) ;
  2461.             }
  2462.          }   
  2463.       }
  2464.    }
  2465.    else
  2466.    {
  2467.       if (MethodUse==2)
  2468.       {
  2469.          if (typeTrade==OP_BUY)
  2470.          {
  2471.             for (i = 1 ; i<100 ; i++)
  2472.             {
  2473.                RetVal = iFractals(Symbol(),0,2,i) ;
  2474.                if (RetVal!=0)
  2475.                {
  2476.                   RetVal = RetVal + NormalizeDouble(MinDistance * Point(),Digits()) ;
  2477.                   if ((Ask + minStopLoss * Point()) < RetVal)
  2478.                   {
  2479.                      break;
  2480.                   }
  2481.                }
  2482.                RetVal = 0 ;
  2483.             }
  2484.          }
  2485.          else
  2486.          {
  2487.             for (i = 1 ; i<100 ; i++)
  2488.             {
  2489.                RetVal = iFractals(Symbol(),0,1,i) ;
  2490.                if (RetVal!=0)
  2491.                {
  2492.                   RetVal = RetVal - NormalizeDouble(MinDistance * Point(),Digits()) ;
  2493.                   break;
  2494.                   if ((Bid-minStopLoss * Point()) > RetVal)
  2495.                   {
  2496.                      break;
  2497.                   }
  2498.                }
  2499.                RetVal = 0 ;
  2500.             }
  2501.          }
  2502.       }
  2503.       if (MethodUse==1)
  2504.       {
  2505.          if (typeTrade==OP_BUY)
  2506.          {
  2507.             for (i = 1 ; i<500 ; i++)
  2508.             {
  2509.                RetVal = NormalizeDouble(MinDistance * Point() + iHigh(Symbol(),0,i),Digits()) ;
  2510.                if (RetVal!=0)
  2511.                {
  2512.                   if (Ask + minStopLoss * Point()<NormalizeDouble(iHigh(Symbol(),0,i) + MinDistance * Point(),Digits()))
  2513.                   break;
  2514.                   RetVal = 0 ;
  2515.                }
  2516.             }
  2517.          }
  2518.          else
  2519.          {
  2520.             for (i = 1 ; i<500 ; i++)
  2521.             {
  2522.                RetVal = NormalizeDouble(iLow(Symbol(),0,i) - MinDistance * Point(),Digits()) ;
  2523.                if (RetVal!=0)
  2524.                {
  2525.                   if (Bid - minStopLoss * Point()>NormalizeDouble(iLow(Symbol(),0,i) - MinDistance * Point(),Digits()))
  2526.                   break;
  2527.                   RetVal = 0 ;
  2528.                }
  2529.             }
  2530.         }
  2531.     }
  2532.   }
  2533.   return(RetVal);
  2534. }  
  2535. //start <<==--------   --------
  2536. void OnTimer()
  2537.   {
  2538.    lizong_20();
  2539.    if(Zong_16_bo_CD != true)
  2540.       return;
  2541.    lizong_12();
  2542.   }
  2543. //OnTimer <<==--------   --------
  2544. void OnChartEvent(const int Mu_0_in, const long & Mu_1_lo, const double & Mu_2_do, const string & Mu_3_st)
  2545.   {
  2546.    string     Lin_st_1;
  2547.    string     Lin_st_2;
  2548.    int        Lin_in_3;
  2549.    string     Lin_st_4;
  2550.    string     Lin_st_5;
  2551.    int        Lin_in_6;
  2552.    int        Lin_in_7;
  2553.    string     Lin_st_8;
  2554.    int        Lin_in_9;
  2555.    string     Lin_st_10;
  2556.    int        Lin_in_11;
  2557.    string     Lin_st_12;
  2558.    int        Lin_in_13;
  2559.    string     Lin_st_14;
  2560.    int        Lin_in_15;
  2561.    if(Mu_0_in == CHARTEVENT_OBJECT_CLICK)
  2562.      {
  2563.       if((Mu_3_st == "tubiao2" || Mu_3_st == "tubiao1"))
  2564.         {
  2565.          if(toggle_console == true)
  2566.            {
  2567.             toggle_console = false ;
  2568.             ObjectDelete(0, "tubiao1");
  2569.            }
  2570.          else
  2571.            {
  2572.             toggle_console = true ;
  2573.             ObjectDelete(0, "tubiao2");
  2574.            }
  2575.          Lin_st_1 = Zong_17_st_D0;
  2576.          for(Lin_in_3 = ObjectsTotal(0, -1, -1) - 1 ; Lin_in_3 >= 0 ; Lin_in_3 = Lin_in_3 - 1)
  2577.            {
  2578.             Lin_st_2 = ObjectName(0, Lin_in_3, -1, -1);
  2579.             if(StringFind(Lin_st_2, Lin_st_1, 0) >= 0)
  2580.               {
  2581.                ObjectDelete(0, Lin_st_2);
  2582.               }
  2583.            }
  2584.          Lin_st_4 = Zong_18_st_E0;
  2585.          for(Lin_in_6 = ObjectsTotal(0, -1, -1) - 1 ; Lin_in_6 >= 0 ; Lin_in_6 = Lin_in_6 - 1)
  2586.            {
  2587.             Lin_st_5 = ObjectName(0, Lin_in_6, -1, -1);
  2588.             if(StringFind(Lin_st_5, Lin_st_4, 0) >= 0)
  2589.               {
  2590.                ObjectDelete(0, Lin_st_5);
  2591.               }
  2592.            }
  2593.          if(!(IsTesting()) && !(lizong_18()))
  2594.            {
  2595.             Comment(Zong_103_st_368 + Zong_3_st_20);
  2596.             ExpertRemove();
  2597.            }
  2598.          lizong_20();
  2599.          if(Zong_16_bo_CD == true)
  2600.            {
  2601.             lizong_12();
  2602.            }
  2603.         }
  2604.       else
  2605.         {
  2606.          if(Mu_3_st == Zong_17_st_D0 + "OpenBoard")
  2607.            {
  2608.             ObjectSetInteger(0, Zong_17_st_D0 + "OpenBoard", OBJPROP_STATE, 0);
  2609.             if(Zong_16_bo_CD)
  2610.               {
  2611.                for(Lin_in_7 = ObjectsTotal(0, -1, -1) - 1 ; Lin_in_7 >= 0 ; Lin_in_7 = Lin_in_7 - 1)
  2612.                  {
  2613.                   if(StringFind(ObjectName(0, Lin_in_7, -1, -1), Zong_18_st_E0, 0) >= 0)
  2614.                     {
  2615.                      ObjectDelete(0, ObjectName(0, Lin_in_7, -1, -1));
  2616.                     }
  2617.                  }
  2618.               }
  2619.             else
  2620.               {
  2621.                lizong_12();
  2622.               }
  2623.             Zong_16_bo_CD = !(Zong_16_bo_CD);
  2624.             ChartRedraw(0);
  2625.            }
  2626.            if (Mu_3_st=="Trade")
  2627.            {
  2628.                if(Stop_Function==false)
  2629.                {
  2630.                   Stop_Function=true;
  2631.                   ObjectSet( "Trade",OBJPROP_BGCOLOR,Green);
  2632.                }
  2633.                else
  2634.                {
  2635.                   Stop_Function=false;
  2636.                   ObjectSet( "Trade",OBJPROP_BGCOLOR,Red);
  2637.                }
  2638.            }   
  2639.         }
  2640.      }
  2641.    if(ObjectGetInteger(0, Zong_18_st_E0 + "StopAll", OBJPROP_STATE, 0) == 1)
  2642.      {
  2643.       Zong_25_bo_114 = false ;
  2644.       Zong_26_bo_115 = false ;
  2645.       if(!(IsTesting()) && !(lizong_18()))
  2646.         {
  2647.          Comment(Zong_103_st_368 + Zong_3_st_20);
  2648.          ExpertRemove();
  2649.         }
  2650.       lizong_20();
  2651.       if(Zong_16_bo_CD == true)
  2652.         {
  2653.          lizong_12();
  2654.         }
  2655.      }
  2656.    else
  2657.      {
  2658.       if(ObjectGetInteger(0, Zong_18_st_E0 + "StopBuy", OBJPROP_STATE, 0) == 1)
  2659.         {
  2660.          Zong_25_bo_114 = false ;
  2661.          if(!(IsTesting()) && !(lizong_18()))
  2662.            {
  2663.             Comment(Zong_103_st_368 + Zong_3_st_20);
  2664.             ExpertRemove();
  2665.            }
  2666.          lizong_20();
  2667.          if(Zong_16_bo_CD == true)
  2668.            {
  2669.             lizong_12();
  2670.            }
  2671.         }
  2672.       else
  2673.         {
  2674.          Zong_25_bo_114 = true ;
  2675.          if(!(IsTesting()) && !(lizong_18()))
  2676.            {
  2677.             Comment(Zong_103_st_368 + Zong_3_st_20);
  2678.             ExpertRemove();
  2679.            }
  2680.          lizong_20();
  2681.          if(Zong_16_bo_CD == true)
  2682.            {
  2683.             lizong_12();
  2684.            }
  2685.         }
  2686.       if(ObjectGetInteger(0, Zong_18_st_E0 + "StopSell", OBJPROP_STATE, 0) == 1)
  2687.         {
  2688.          Zong_26_bo_115 = false ;
  2689.          if(!(IsTesting()) && !(lizong_18()))
  2690.            {
  2691.             Comment(Zong_103_st_368 + Zong_3_st_20);
  2692.             ExpertRemove();
  2693.            }
  2694.          lizong_20();
  2695.          if(Zong_16_bo_CD == true)
  2696.            {
  2697.             lizong_12();
  2698.            }
  2699.         }
  2700.       else
  2701.         {
  2702.          Zong_26_bo_115 = true ;
  2703.          if(!(IsTesting()) && !(lizong_18()))
  2704.            {
  2705.             Comment(Zong_103_st_368 + Zong_3_st_20);
  2706.             ExpertRemove();
  2707.            }
  2708.          lizong_20();
  2709.          if(Zong_16_bo_CD == true)
  2710.            {
  2711.             lizong_12();
  2712.            }
  2713.         }
  2714.      }
  2715.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseAll", OBJPROP_STATE, 0) == 1)
  2716.      {
  2717.       lizong_13(0);
  2718.       ObjectSetInteger(0, Zong_18_st_E0 + "CloseAll", OBJPROP_STATE, 0);
  2719.      }
  2720.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseBuy", OBJPROP_STATE, 0) == 1)
  2721.      {
  2722.       lizong_13(1);
  2723.       ObjectSetInteger(0, Zong_18_st_E0 + "CloseBuy", OBJPROP_STATE, 0);
  2724.      }
  2725.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseSell", OBJPROP_STATE, 0) == 1)
  2726.      {
  2727.       lizong_13(-1);
  2728.       ObjectSetInteger(0, Zong_18_st_E0 + "CloseSell", OBJPROP_STATE, 0);
  2729.      }
  2730.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseProfit", OBJPROP_STATE, 0) == 1)
  2731.      {
  2732.       Lin_st_8 = "Profit";
  2733.       for(Lin_in_9 = OrdersTotal() - 1 ; Lin_in_9 >= 0 ; Lin_in_9 = Lin_in_9 - 1)
  2734.         {
  2735.          if(!(OrderSelect(Lin_in_9, 0, 0)))
  2736.             continue;
  2737.          if(((string(Magic) == "" || OrderMagicNumber() != Magic) && string(Magic) != ""))
  2738.             continue;
  2739.          if(Lin_st_8 == "Profit" && OrderProfit() + OrderSwap() >= 0.0)
  2740.            {
  2741.             if(OrderType() == 0)
  2742.               {
  2743.                bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), Zong_27_in_118, Blue);
  2744.                continue;
  2745.               }
  2746.             if(OrderType() != 1)
  2747.                continue;
  2748.             bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), Zong_27_in_118, Red);
  2749.             continue;
  2750.            }
  2751.          if(Lin_st_8 != "Loss" || !(OrderProfit() + OrderSwap() < 0.0))
  2752.             continue;
  2753.          if(OrderType() == 0)
  2754.            {
  2755.             bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), Zong_27_in_118, Blue);
  2756.             continue;
  2757.            }
  2758.          if(OrderType() != 1)
  2759.             continue;
  2760.          bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), Zong_27_in_118, Red);
  2761.         }
  2762.       ObjectSetInteger(0, Zong_18_st_E0 + "CloseProfit", OBJPROP_STATE, 0);
  2763.      }
  2764.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseLoss", OBJPROP_STATE, 0) == 1)
  2765.      {
  2766.       Lin_st_10 = "Loss";
  2767.       for(Lin_in_11 = OrdersTotal() - 1 ; Lin_in_11 >= 0 ; Lin_in_11 = Lin_in_11 - 1)
  2768.         {
  2769.          if(!(OrderSelect(Lin_in_11, 0, 0)))
  2770.             continue;
  2771.          if(((string(Magic) == "" || OrderMagicNumber() != Magic) && string(Magic) != ""))
  2772.             continue;
  2773.          if(Lin_st_10 == "Profit" && OrderProfit() + OrderSwap() >= 0.0)
  2774.            {
  2775.             if(OrderType() == 0)
  2776.               {
  2777.                bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), Zong_27_in_118, Blue);
  2778.                continue;
  2779.               }
  2780.             if(OrderType() != 1)
  2781.                continue;
  2782.             bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), Zong_27_in_118, Red);
  2783.             continue;
  2784.            }
  2785.          if(Lin_st_10 != "Loss" || !(OrderProfit() + OrderSwap() < 0.0))
  2786.             continue;
  2787.          if(OrderType() == 0)
  2788.            {
  2789.             bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), Zong_27_in_118, Blue);
  2790.             continue;
  2791.            }
  2792.          if(OrderType() != 1)
  2793.             continue;
  2794.          bool res = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), Zong_27_in_118, Red);
  2795.         }
  2796.       ObjectSetInteger(0, Zong_18_st_E0 + "CloseLoss", OBJPROP_STATE, 0);
  2797.      }
  2798.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseSymbol", OBJPROP_STATE, 0) == 1)
  2799.      {
  2800.       Lin_st_12 = Symbol();
  2801.       for(Lin_in_13 = OrdersTotal() - 1 ; Lin_in_13 >= 0 ; Lin_in_13 = Lin_in_13 - 1)
  2802.         {
  2803.          if(!(OrderSelect(Lin_in_13, 0, 0)))
  2804.             continue;
  2805.          if((Lin_st_12 != "all" && OrderSymbol() != Lin_st_12))
  2806.             continue;
  2807.          if(OrderType() == 0)
  2808.            {
  2809.             bool res = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), Zong_27_in_118, Blue);
  2810.             continue;
  2811.            }
  2812.          if(OrderType() != 1)
  2813.             continue;
  2814.          bool res = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), Zong_27_in_118, Red);
  2815.         }
  2816.       ObjectSetInteger(0, Zong_18_st_E0 + "CloseSymbol", OBJPROP_STATE, 0);
  2817.      }
  2818.    if(ObjectGetInteger(0, Zong_18_st_E0 + "CloseAccountAll", OBJPROP_STATE, 0) != 1)
  2819.       return;
  2820.    Lin_st_14 = "all";
  2821.    for(Lin_in_15 = OrdersTotal() - 1 ; Lin_in_15 >= 0 ; Lin_in_15 = Lin_in_15 - 1)
  2822.      {
  2823.       if(!(OrderSelect(Lin_in_15, 0, 0)))
  2824.          continue;
  2825.       if((Lin_st_14 != "all" && OrderSymbol() != Lin_st_14))
  2826.          continue;
  2827.       if(OrderType() == 0)
  2828.         {
  2829.          bool res = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), Zong_27_in_118, Blue);
  2830.          continue;
  2831.         }
  2832.       if(OrderType() != 1)
  2833.          continue;
  2834.       bool res = OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), Zong_27_in_118, Red);
  2835.      }
  2836.    ObjectSetInteger(0, Zong_18_st_E0 + "CloseAccountAll", OBJPROP_STATE, 0);
  2837.   }
  2838. //OnChartEvent <<==--------   --------
  2839. int deinit()
  2840.   {
  2841.    ObjectDelete("HLINE_LONGII");
  2842.    ObjectDelete("HLINE_SHORTII");
  2843.    ObjectDelete("HLINE_LONG");
  2844.    ObjectDelete("HLINE_SHORT");
  2845.    ObjectsDeleteAll(0, -1);
  2846.    return(0);
  2847.   }
  2848. //deinit <<==--------   --------
  2849. void lizong_12()
  2850.   {
  2851.    int       Zi_1_in;
  2852.    int       Zi_2_in;
  2853.    int       Zi_3_in;
  2854. //----- -----
  2855.    uint       Lin_ui_1;
  2856.    long       Lin_lo_2;
  2857.    Zi_1_in = Zong_24_in_110 ;
  2858.    Zi_2_in = 3 ;
  2859.    Zi_3_in = 30 ;
  2860.    Lin_ui_1 = PowderBlue;
  2861.    Lin_lo_2 = 0;
  2862.    if(ObjectFind(0, Zong_18_st_E0 + "Panel") <  0)
  2863.      {
  2864.       ObjectCreate(0, Zong_18_st_E0 + "Panel", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  2865.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_XDISTANCE, 308+XDis_Diff);
  2866.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_YDISTANCE, Zong_24_in_110);
  2867.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_XSIZE, 300);
  2868.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_YSIZE, 205);
  2869.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_BORDER_TYPE, 0);
  2870.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_CORNER, 1);
  2871.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_COLOR, 15453831);
  2872.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_STYLE, 0);
  2873.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_WIDTH, 1);
  2874.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_BACK, 0);
  2875.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_SELECTABLE, 0);
  2876.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_SELECTED, 0);
  2877.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_HIDDEN, 1);
  2878.       ObjectSetInteger(0, Zong_18_st_E0 + "Panel", OBJPROP_ZORDER, 0);
  2879.      }
  2880.    ObjectSetInteger(Lin_lo_2, Zong_18_st_E0 + "Panel", OBJPROP_BGCOLOR, Lin_ui_1);
  2881.    Zi_1_in += Zi_2_in;
  2882.    lizong_22(Zong_18_st_E0 + "StopAll", "Stop trading", "Start trading", 298, Zi_1_in, 280, Zi_3_in, Zong_22_in_104, White, White, Brown, SteelBlue, Zong_21_st_F8, Zong_19_in_EC);
  2883.    Zi_1_in = Zi_1_in + Zi_2_in + Zi_3_in;
  2884.    lizong_22(Zong_18_st_E0 + "StopBuy", "Stop going long", "Start going long", 298, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Brown, SteelBlue, Zong_21_st_F8, Zong_19_in_EC);
  2885.    lizong_22(Zong_18_st_E0 + "StopSell", "Stop short selling", "Start short selling", 154, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Brown, SteelBlue, Zong_21_st_F8, Zong_19_in_EC);
  2886.    Zi_1_in = Zi_1_in + Zi_2_in + Zi_3_in;
  2887.    lizong_22(Zong_18_st_E0 + "CloseProfit", "Close the profit order", "Close the profit order", 298, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Teal, Teal, Zong_21_st_F8, Zong_19_in_EC);
  2888.    lizong_22(Zong_18_st_E0 + "CloseLoss", "Losing positions closed", "Losing positions being closed", 154, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Teal, Teal, Zong_21_st_F8, Zong_19_in_EC);
  2889.    Zi_1_in = Zi_1_in + Zi_2_in + Zi_3_in;
  2890.    lizong_22(Zong_18_st_E0 + "CloseBuy", "Long positions closed", "Long positions being closed", 298, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Teal, Teal, Zong_21_st_F8, Zong_19_in_EC);
  2891.    lizong_22(Zong_18_st_E0 + "CloseSell", "Short positions closed", "Short positions being closed", 154, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Teal, Teal, Zong_21_st_F8, Zong_19_in_EC);
  2892.    Zi_1_in = Zi_1_in + Zi_2_in + Zi_3_in;
  2893.    lizong_22(Zong_18_st_E0 + "CloseSymbol", Symbol() + "Close all positions", Symbol() + "All positions are being closed.", 298, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Teal, Teal, Zong_21_st_F8, Zong_19_in_EC);
  2894.    lizong_22(Zong_18_st_E0 + "CloseAll", "All EAs closed", "All EAs being closed", 154, Zi_1_in, 135, Zi_3_in, Zong_22_in_104, White, White, Teal, Teal, Zong_21_st_F8, Zong_19_in_EC);
  2895.    Zi_1_in = Zi_1_in + Zi_2_in + Zi_3_in;
  2896.    lizong_22(Zong_18_st_E0 + "CloseAccountAll","All positions in this account have been liquidated","All positions in this account are being liquidated.", 298, Zi_1_in, 280, Zi_3_in, Zong_22_in_104, White, White, SeaGreen, DodgerBlue, Zong_21_st_F8, Zong_19_in_EC);
  2897.   }
  2898. //lizong_12 <<==--------   --------
  2899. int lizong_13(int Mu_0_in)
  2900.   {
  2901.    int       Zi_2_in = 0;
  2902.    int       Zi_3_in = 0;
  2903.    int       Zi_4_in;
  2904.    int       Zi_5_in;
  2905.    bool      Zi_6_bo;
  2906.    int       Zi_7_in;
  2907.    int       Zi_8_in;
  2908. //----- -----
  2909.    Zi_4_in = 0 ;
  2910.    Zi_5_in = 0 ;
  2911.    Zi_6_bo = false ;
  2912.    for(; ;)
  2913.      {
  2914.       for(Zi_7_in = OrdersTotal() - 1 ; Zi_7_in >= 0 ; Zi_7_in --)
  2915.         {
  2916.          if(!(OrderSelect(Zi_7_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  2917.             continue;
  2918.          Zi_4_in = OrderType() ;
  2919.          if(Zi_4_in == 0 && (Mu_0_in == 1 || Mu_0_in == 0))
  2920.            {
  2921.             Zi_6_bo = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits()), int(Zong_27_in_118 * Zong_28_do_120), 0xFFFFFFFF) ;
  2922.             if(Zi_6_bo)
  2923.               {
  2924.                Comment("", OrderTicket(), "", OrderProfit(), "     ", TimeToString(GetSystemTime(), 4));
  2925.               }
  2926.            }
  2927.          if(Zi_4_in == 1 && (Mu_0_in == -1 || Mu_0_in == 0))
  2928.            {
  2929.             Zi_6_bo = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits()), int(Zong_27_in_118 * Zong_28_do_120), 0xFFFFFFFF) ;
  2930.             if(Zi_6_bo)
  2931.               {
  2932.                Comment("", OrderTicket(), "", OrderProfit(), "     ", TimeToString(GetSystemTime(), 4));
  2933.               }
  2934.            }
  2935.          if((Zi_4_in == 4 || Zi_4_in == 5))
  2936.            {
  2937.             Zi_6_bo = OrderDelete(OrderTicket(), 0xFFFFFFFF) ;
  2938.            }
  2939.          if(Zi_6_bo)
  2940.             continue;
  2941.          Zi_2_in = GetLastError() ;
  2942.          if(Zi_2_in < 2)
  2943.             continue;
  2944.          if(Zi_2_in == 129)
  2945.            {
  2946.             Comment("", TimeToString(GetSystemTime(), 4));
  2947.             RefreshRates();
  2948.             continue;
  2949.            }
  2950.          if(Zi_2_in == 146)
  2951.            {
  2952.             if(!(IsTradeContextBusy()))
  2953.                continue;
  2954.             Sleep(2000);
  2955.             continue;
  2956.            }
  2957.          Comment("", Zi_2_in, "", OrderTicket(), "     ", TimeToString(GetSystemTime(), 4));
  2958.         }
  2959.       Zi_5_in = 0 ;
  2960.       for(Zi_8_in = 0 ; Zi_8_in < OrdersTotal() ; Zi_8_in ++)
  2961.         {
  2962.          if(!(OrderSelect(Zi_8_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  2963.             continue;
  2964.          Zi_4_in = OrderType() ;
  2965.          if((Zi_4_in == 4 || Zi_4_in == 0) && (Mu_0_in == 1 || Mu_0_in == 0))
  2966.            {
  2967.             Zi_5_in ++;
  2968.            }
  2969.          if((Zi_4_in != 5 && Zi_4_in != 1))
  2970.             continue;
  2971.          if((Mu_0_in != -1 && Mu_0_in != 0))
  2972.             continue;
  2973.          Zi_5_in ++;
  2974.         }
  2975.       if(Zi_5_in == 0)
  2976.          break;
  2977.       Zi_3_in ++;
  2978.       if(Zi_3_in >  10)
  2979.         {
  2980.          Print(Symbol(), "If more than 10 positions have been closed, the remaining number of open positions is:", Zi_5_in);
  2981.          return(0);
  2982.         }
  2983.       Sleep(1000);
  2984.       RefreshRates();
  2985.       continue;
  2986.      }
  2987.    return(1);
  2988.   }
  2989. //lizong_13 <<==--------   --------
  2990. int lizong_14(int Mu_0_in)
  2991.   {
  2992.    int       Zi_2_in = 0;
  2993.    int       Zi_3_in = 0;
  2994.    int       Zi_4_in = 0;
  2995.    int       Zi_5_in = 0;
  2996.    bool      Zi_6_bo = false;
  2997.    int       Zi_7_in = 0;
  2998. //----- -----
  2999.    Zi_4_in = 0 ;
  3000.    Zi_5_in = 0 ;
  3001.    Zi_6_bo = true ;
  3002.    for(; ;)
  3003.      {
  3004.       for(Zi_7_in = OrdersTotal() - 1 ; Zi_7_in >= 0 ; Zi_7_in --)
  3005.         {
  3006.          if(!(OrderSelect(Zi_7_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  3007.             continue;
  3008.          Zi_4_in = OrderType() ;
  3009.          if(Zi_4_in == 0 && (Mu_0_in == 1 || Mu_0_in == 0))
  3010.            {
  3011.             Zi_6_bo = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits()), Zong_50_in_190, Blue) ;
  3012.             if(Zi_6_bo)
  3013.               {
  3014.                Comment("", OrderTicket(), "", OrderProfit(), "     ", TimeToString(GetSystemTime(), 4));
  3015.               }
  3016.            }
  3017.          if(Zi_4_in == 1 && (Mu_0_in == -1 || Mu_0_in == 0))
  3018.            {
  3019.             Zi_6_bo = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits()), Zong_50_in_190, Red) ;
  3020.             if(Zi_6_bo)
  3021.               {
  3022.                Comment("", OrderTicket(), "", OrderProfit(), "     ", TimeToString(GetSystemTime(), 4));
  3023.               }
  3024.            }
  3025.          if(Zi_4_in == 4 && (Mu_0_in == 1 || Mu_0_in == 0))
  3026.            {
  3027.             Zi_6_bo = OrderDelete(OrderTicket(), 0xFFFFFFFF) ;
  3028.            }
  3029.          if(Zi_4_in == 5 && (Mu_0_in == -1 || Mu_0_in == 0))
  3030.            {
  3031.             Zi_6_bo = OrderDelete(OrderTicket(), 0xFFFFFFFF) ;
  3032.            }
  3033.          if(Zi_6_bo)
  3034.             continue;
  3035.          Zi_2_in = GetLastError() ;
  3036.          if(Zi_2_in < 2)
  3037.             continue;
  3038.          if(Zi_2_in == 129)
  3039.            {
  3040.             Comment("", TimeToString(GetSystemTime(), 4));
  3041.             RefreshRates();
  3042.             continue;
  3043.            }
  3044.          if(Zi_2_in == 146)
  3045.            {
  3046.             if(!(IsTradeContextBusy()))
  3047.                continue;
  3048.             Sleep(2000);
  3049.             continue;
  3050.            }
  3051.          Comment("", Zi_2_in, "", OrderTicket(), "     ", TimeToString(GetSystemTime(), 4));
  3052.         }
  3053.       Zi_5_in = 0 ;
  3054.       for(Zi_7_in = 0 ; Zi_7_in < OrdersTotal() ; Zi_7_in ++)
  3055.         {
  3056.          if(!(OrderSelect(Zi_7_in, 0, 0)) || OrderSymbol() != Symbol() || OrderMagicNumber() != Magic)
  3057.             continue;
  3058.          Zi_4_in = OrderType() ;
  3059.          if((Zi_4_in == 4 || Zi_4_in == 0) && (Mu_0_in == 1 || Mu_0_in == 0))
  3060.            {
  3061.             Zi_5_in ++;
  3062.            }
  3063.          if((Zi_4_in != 5 && Zi_4_in != 1))
  3064.             continue;
  3065.          if((Mu_0_in != -1 && Mu_0_in != 0))
  3066.             continue;
  3067.          Zi_5_in ++;
  3068.         }
  3069.       if(Zi_5_in == 0)
  3070.          break;
  3071.       Zi_3_in ++;
  3072.       if(Zi_3_in >  10)
  3073.         {
  3074.          Print(Symbol(), "Closed positions more than 10 times", Zi_5_in);
  3075.          return(0);
  3076.         }
  3077.       Sleep(1000);
  3078.       RefreshRates();
  3079.       continue;
  3080.      }
  3081.    return(1);
  3082.   }
  3083. //lizong_14 <<==--------   --------
  3084. int lizong_15(int Mu_0_in)
  3085.   {
  3086.    if(Mu_0_in >  43200)
  3087.      {
  3088.       return(0);
  3089.      }
  3090.    if(Mu_0_in >  10080)
  3091.      {
  3092.       return(43200);
  3093.      }
  3094.    if(Mu_0_in >  1440)
  3095.      {
  3096.       return(10080);
  3097.      }
  3098.    if(Mu_0_in >  240)
  3099.      {
  3100.       return(1440);
  3101.      }
  3102.    if(Mu_0_in >  60)
  3103.      {
  3104.       return(240);
  3105.      }
  3106.    if(Mu_0_in >  30)
  3107.      {
  3108.       return(60);
  3109.      }
  3110.    if(Mu_0_in >  15)
  3111.      {
  3112.       return(30);
  3113.      }
  3114.    if(Mu_0_in >  5)
  3115.      {
  3116.       return(15);
  3117.      }
  3118.    if(Mu_0_in >  1)
  3119.      {
  3120.       return(5);
  3121.      }
  3122.    if(Mu_0_in == 1)
  3123.      {
  3124.       return(1);
  3125.      }
  3126.    if(Mu_0_in == 0)
  3127.      {
  3128.       return(Period());
  3129.      }
  3130.    return(0);
  3131.   }
  3132. //lizong_15 <<==--------   --------
  3133. void lizong_16(int Mu_0_in, int Mu_1_in, int Mu_2_in, int Mu_3_in)
  3134.   {
  3135.    int       Zi_1_in = 0;
  3136.    int       Zi_2_in = 0;
  3137.    int       Zi_3_in;
  3138.    double    Zi_4_do;
  3139.    int       Zi_5_in;
  3140. //----- -----
  3141.    Zi_3_in = 0 ;
  3142.    Zi_4_do = 0.0 ;
  3143.    Zi_5_in = 0 ;
  3144.    while(Mu_2_in > 0)
  3145.      {
  3146.       Zi_1_in = Mu_1_in ;
  3147.       Zi_2_in = Mu_0_in ;
  3148.       Zi_3_in = -1 ;
  3149.       Zi_4_do = 0.0 ;
  3150.       for(Zi_5_in = OrdersTotal() - 1 ; Zi_5_in >= 0 ; Zi_5_in --)
  3151.         {
  3152.          if(!(OrderSelect(Zi_5_in, 0, 0)) || OrderSymbol() != Symbol())
  3153.             continue;
  3154.          if((OrderMagicNumber() != Zi_1_in && Zi_1_in != -1))
  3155.             continue;
  3156.          if((OrderType() != Zi_2_in && Zi_2_in != -100))
  3157.             continue;
  3158.          if(Mu_3_in == 1 && Zi_4_do < OrderProfit())
  3159.            {
  3160.             Zi_4_do = OrderProfit() ;
  3161.             Zi_3_in = OrderTicket() ;
  3162.            }
  3163.          if(Mu_3_in != 2)
  3164.             continue;
  3165.          if((!(Zi_4_do > OrderProfit()) && !(Zi_4_do == 0.0)))
  3166.             continue;
  3167.          Zi_4_do = OrderProfit() ;
  3168.          Zi_3_in = OrderTicket() ;
  3169.         }
  3170.       if(OrderSelect(Zi_3_in, 1, 0))
  3171.         {
  3172.          if(Mu_3_in == 1 && OrderProfit() >= 0.0 && OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0, 0xFFFFFFFF))
  3173.            {
  3174.             Mu_2_in --;
  3175.            }
  3176.          if(Mu_3_in == 1 && OrderProfit() < 0.0)
  3177.            {
  3178.             Mu_2_in --;
  3179.            }
  3180.          if(Mu_3_in == 2 && OrderProfit() < 0.0 && OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0, 0xFFFFFFFF))
  3181.            {
  3182.             Mu_2_in --;
  3183.            }
  3184.          if(Mu_3_in != 2 || !(OrderProfit() >= 0.0))
  3185.             continue;
  3186.          Mu_2_in --;
  3187.          continue;
  3188.         }
  3189.       Mu_2_in --;
  3190.      }
  3191.   }
  3192. //lizong_16 <<==--------   --------
  3193. double lizong_17(int Mu_0_in, int Mu_1_in, int Mu_2_in, int Mu_3_in)
  3194.   {
  3195.    double    Zi_2_do_si100[100];
  3196.    int       Zi_3_in = 0;
  3197.    int       Zi_4_in = 0;
  3198.    double    Zi_5_do = 0.0;
  3199. //----- -----
  3200.    Zi_4_in = 0 ;
  3201.    Zi_5_do = 0.0 ;
  3202.    ArrayInitialize(Zi_2_do_si100, 0.0);
  3203.    Zi_3_in = 0 ;
  3204.    for(Zi_4_in = OrdersTotal() - 1 ; Zi_4_in >= 0 ; Zi_4_in --)
  3205.      {
  3206.       if(!(OrderSelect(Zi_4_in, 0, 0)) || OrderSymbol() != Symbol())
  3207.          continue;
  3208.       if((OrderMagicNumber() != Mu_1_in && Mu_1_in != -1))
  3209.          continue;
  3210.       if((OrderType() != Mu_0_in && Mu_0_in != -100))
  3211.          continue;
  3212.       if(Mu_2_in == 1 && OrderProfit() >= 0.0)
  3213.         {
  3214.          Zi_2_do_si100[Zi_3_in] = OrderProfit();
  3215.          Zi_3_in ++;
  3216.         }
  3217.       if(Mu_2_in != 2 || !(OrderProfit() < 0.0))
  3218.          continue;
  3219.       Zi_2_do_si100[Zi_3_in] =  -(OrderProfit());
  3220.       Zi_3_in ++;
  3221.      }
  3222.    ArraySort(Zi_2_do_si100, 0, 0, 2);
  3223.    Zi_5_do = 0.0 ;
  3224.    for(Zi_4_in = 0 ; Zi_4_in < Mu_3_in ; Zi_4_in ++)
  3225.      {
  3226.       Zi_5_do = Zi_5_do + Zi_2_do_si100[Zi_4_in] ;
  3227.      }
  3228.    return(Zi_5_do);
  3229.   }
  3230. //lizong_17 <<==--------   --------
  3231. bool lizong_18()
  3232.   {
  3233.    int       Zi_2_in;
  3234.    int       Zi_3_in;
  3235.    uchar     Zi_4_uc_si1024[1024];
  3236.    int       Zi_5_in;
  3237.    string    Zi_6_st;
  3238.    int       Zi_7_in;
  3239.    int       Zi_8_in;
  3240.    datetime  Zi_9_da;
  3241.    datetime  Zi_10_da;
  3242. //----- -----
  3243.    if(Authorization == "")
  3244.      {
  3245.       Authorization = (string)GlobalVariableGet(Zong_4_st_30 + string(AccountNumber()) + "AuthCode") ;
  3246.      }
  3247.    if(Authorization == "0")
  3248.      {
  3249.       Authorization = (string)AccountNumber() ;
  3250.      }
  3251.    GlobalVariableSet(Zong_4_st_30 + string(AccountNumber()) + "AuthCode", (double)Authorization);
  3252.    Zong_13_da_C0 = iTime(NULL, PERIOD_D1, 0) ;
  3253.    Zong_2_st_10 = Zong_1_st_0 + Authorization;
  3254.    Zi_2_in = 0; // InternetOpenW("MT4",1,"","",0) ;
  3255.    if(Zi_2_in == 0)
  3256.      {
  3257.       Zong_3_st_20 = "";//Zong_144_st_5F8 ;
  3258.       return(true);// return(false);
  3259.      }
  3260.    Zi_3_in = 0;
  3261.    if(Zi_3_in == 0)
  3262.      {
  3263.       Zong_3_st_20 = Zong_144_st_5F8 ;
  3264.       return(false);
  3265.      }
  3266.    Zi_5_in = 0 ;
  3267.    Zi_6_st = "" ;
  3268.      {
  3269.       while(Zi_5_in > 0)
  3270.         {
  3271.          for(Zi_7_in = 0 ; Zi_7_in < Zi_5_in ; Zi_7_in ++)
  3272.            {
  3273.            Zi_4_uc_si1024[Zi_7_in] = 0;
  3274.             Zi_6_st += CharToString(Zi_4_uc_si1024[Zi_7_in]);
  3275.            }
  3276.             break;
  3277.         }
  3278.      }
  3279.    Zi_8_in = StringFind(Zi_6_st, string(AccountNumber()), 0) ;
  3280.    if(Zi_8_in <  0)
  3281.      {
  3282.       Alert(Zong_145_st_608);
  3283.       Zong_3_st_20 = Zong_145_st_608 ;
  3284.       ExpertRemove();
  3285.       return(false);
  3286.      }
  3287.    Zi_8_in = StringFind(Zi_6_st, "class="info-value expire-date valid">", 0) ;
  3288.    if(Zi_8_in >= 0)
  3289.      {
  3290.       Zi_8_in += 37;
  3291.       Zong_3_st_20 = StringSubstr(Zi_6_st, Zi_8_in, 10) ;
  3292.       StringReplace(Zong_3_st_20, "-", ".");
  3293.       Zi_9_da = StringToTime(Zong_3_st_20) ;
  3294.       Zi_10_da = GetSystemTime();                     
  3295.       Zi_10_da -= Zi_10_da % 86400;
  3296.       Zong_14_in_C8 = int((Zi_9_da - Zi_10_da) / 86400) ;
  3297.       return(true);
  3298.      }
  3299.    Zi_8_in = StringFind(Zi_6_st, "class="info-value expire-date expired">", 0) ;
  3300.    if(Zi_8_in >= 0)
  3301.      {
  3302.       Zi_8_in += 39;
  3303.       Zong_3_st_20 = StringSubstr(Zi_6_st, Zi_8_in, 10) ;
  3304.       Alert(StringFormat(Zong_146_st_618, Zong_3_st_20));
  3305.       return(false);
  3306.      }
  3307.    Zong_3_st_20 = Zong_144_st_5F8 ;
  3308.    Alert(Zong_144_st_5F8);
  3309.    return(false);
  3310.   }
  3311. //lizong_18 <<==--------   --------
  3312. bool lizong_19(string Mu_0_st, string Mu_1_st, ulong Mu_2_ul)
  3313.   {
  3314.    int       Zi_2_in;
  3315.    ulong     Zi_3_ul;
  3316.    int       Zi_4_in;
  3317.    int       Zi_5_in;
  3318.    uchar     Zi_6_uc_si1024[1024];
  3319.    int       Zi_7_in;
  3320. //----- -----
  3321.    Zi_2_in = FileOpen(Mu_1_st, 7) ;
  3322.    Zi_3_ul = FileSize(Zi_2_in) ;
  3323.    if(Zi_2_in == -1)
  3324.      {
  3325.       Print("打开logo文件失败");
  3326.       return(false);
  3327.      }
  3328.    if(Zi_3_ul == Mu_2_ul)
  3329.      {
  3330.       FileClose(Zi_2_in);
  3331.       return(true);
  3332.      }
  3333.    Zi_4_in = 0 ;
  3334.    if(Zi_4_in == 0)
  3335.      {
  3336.       return(false);
  3337.      }
  3338.    Zi_5_in =0 ;
  3339.    if(Zi_5_in == 0)
  3340.      {
  3341.       return(false);
  3342.      }
  3343.    Zi_7_in = 0 ;
  3344.      {
  3345.       while(Zi_7_in > 0)
  3346.         {
  3347.          FileWriteArray(Zi_2_in, Zi_6_uc_si1024, 0, Zi_7_in);
  3348.             break;
  3349.         }
  3350.      }
  3351.    FileClose(Zi_2_in);
  3352.    return(true);
  3353.   }
  3354. //lizong_19 <<==--------   --------
  3355. void lizong_20()
  3356.   {
  3357.    string    Zi_1_st;
  3358.    int       Zi_2_in;
  3359.    string    Zi_3_st;
  3360.    int       Zi_4_in;
  3361.    double    Zi_5_do;
  3362.    double    Zi_6_do;
  3363.    double    Zi_7_do;
  3364.    string    Zi_10_st;
  3365.    string    Zi_11_st;
  3366.    string    Zi_12_st;
  3367. //----- -----
  3368.    uint       Lin_ui_1;
  3369.    long       Lin_lo_2;
  3370.    uint       Lin_ui_3;
  3371.    long       Lin_lo_4;
  3372.    uint       Lin_ui_5;
  3373.    long       Lin_lo_6;
  3374.    int        Lin_in_7;
  3375.    string     Lin_st_8;
  3376.    uint       Lin_ui_9;
  3377.    string     Lin_st_10;
  3378.    int        Lin_in_11;
  3379.    string     Lin_st_12;
  3380.    uint       Lin_ui_13;
  3381.    string     Lin_st_14;
  3382.    int        Lin_in_15;
  3383.    string     Lin_st_16;
  3384.    uint       Lin_ui_17;
  3385.    string     Lin_st_18;
  3386.    int        Lin_in_19;
  3387.    string     Lin_st_20;
  3388.    uint       Lin_ui_21;
  3389.    string     Lin_st_22;
  3390.    int        Lin_in_23;
  3391.    string     Lin_st_24;
  3392.    uint       Lin_ui_25;
  3393.    string     Lin_st_26;
  3394.    int        Lin_in_27;
  3395.    string     Lin_st_28;
  3396.    uint       Lin_ui_29;
  3397.    string     Lin_st_30;
  3398.    string     Lin_st_31;
  3399.    int        Lin_in_32;
  3400.    int        Lin_in_33;
  3401.    double     Lin_do_34;
  3402.    long       Lin_lo_36;
  3403.    int        Lin_in_37;
  3404.    int        Lin_in_38;
  3405.    int        Lin_in_39;
  3406.    string     Lin_st_40;
  3407.    int        Lin_in_41;
  3408.    uint       Lin_ui_42;
  3409.    string     Lin_st_43;
  3410.    int        Lin_in_44;
  3411.    string     Lin_st_45;
  3412.    int        Lin_in_46;
  3413.    uint       Lin_ui_47;
  3414.    string     Lin_st_48;
  3415.    int        Lin_in_49;
  3416.    string     Lin_st_50;
  3417.    uint       Lin_ui_51;
  3418.    string     Lin_st_52;
  3419.    string     Lin_st_53;
  3420.    int        Lin_in_54;
  3421.    int        Lin_in_55;
  3422.    double     Lin_do_56;
  3423.    double     Lin_do_57;
  3424.    long       Lin_lo_58;
  3425.    int        Lin_in_59;
  3426.    int        Lin_in_60;
  3427.    int        Lin_in_61;
  3428.    string     Lin_st_62;
  3429.    int        Lin_in_63;
  3430.    uint       Lin_ui_64;
  3431.    string     Lin_st_65;
  3432.    int        Lin_in_66;
  3433.    string     Lin_st_67;
  3434.    int        Lin_in_68;
  3435.    uint       Lin_ui_69;
  3436.    string     Lin_st_70;
  3437.    int        Lin_in_71;
  3438.    string     Lin_st_72;
  3439.    uint       Lin_ui_73;
  3440.    string     Lin_st_74;
  3441.    string     Lin_st_75;
  3442.    int        Lin_in_76;
  3443.    int        Lin_in_77;
  3444.    double     Lin_do_78;
  3445.    double     Lin_do_79;
  3446.    long       Lin_lo_80;
  3447.    int        Lin_in_81;
  3448.    int        Lin_in_82;
  3449.    int        Lin_in_83;
  3450.    string     Lin_st_84;
  3451.    int        Lin_in_85;
  3452.    uint       Lin_ui_86;
  3453.    string     Lin_st_87;
  3454.    int        Lin_in_88;
  3455.    string     Lin_st_89;
  3456.    int        Lin_in_90;
  3457.    uint       Lin_ui_91;
  3458.    string     Lin_st_92;
  3459.    int        Lin_in_93;
  3460.    string     Lin_st_94;
  3461.    uint       Lin_ui_95;
  3462.    string     Lin_st_96;
  3463.    int        Lin_in_97;
  3464.    string     Lin_st_98;
  3465.    uint       Lin_ui_99;
  3466.    string     Lin_st_100;
  3467.    int        Lin_in_101;
  3468.    string     Lin_st_102;
  3469.    uint       Lin_ui_103;
  3470.    string     Lin_st_104;
  3471.    int        Lin_in_105;
  3472.    string     Lin_st_106;
  3473.    uint       Lin_ui_107;
  3474.    string     Lin_st_108;
  3475.    int        Lin_in_109;
  3476.    string     Lin_st_110;
  3477.    uint       Lin_ui_111;
  3478.    string     Lin_st_112;
  3479.    int        Lin_in_113;
  3480.    string     Lin_st_114;
  3481.    uint       Lin_ui_115;
  3482.    string     Lin_st_116;
  3483.    int        Lin_in_117;
  3484.    string     Lin_st_118;
  3485.    uint       Lin_ui_119;
  3486.    string     Lin_st_120;
  3487.    string     Lin_st_121;
  3488.    int        Lin_in_122;
  3489.    double     Lin_do_123;
  3490.    int        Lin_in_124;
  3491.    string     Lin_st_125;
  3492.    int        Lin_in_126;
  3493.    double     Lin_do_127;
  3494.    int        Lin_in_128;
  3495.    string     Lin_st_129;
  3496.    int        Lin_in_130;
  3497.    double     Lin_do_131;
  3498.    int        Lin_in_132;
  3499.    string     Lin_st_133;
  3500.    int        Lin_in_134;
  3501.    double     Lin_do_135;
  3502.    int        Lin_in_136;
  3503.    uint       Lin_ui_137;
  3504.    long       Lin_lo_138;
  3505.    int        Lin_in_139;
  3506.    string     Lin_st_140;
  3507.    uint       Lin_ui_141;
  3508.    string     Lin_st_142;
  3509.    int        Lin_in_143;
  3510.    string     Lin_st_144;
  3511.    uint       Lin_ui_145;
  3512.    string     Lin_st_146;
  3513.    int        Lin_in_147;
  3514.    string     Lin_st_148;
  3515.    uint       Lin_ui_149;
  3516.    string     Lin_st_150;
  3517.    uint       Lin_ui_151;
  3518.    long       Lin_lo_152;
  3519.    int        Lin_in_153;
  3520.    string     Lin_st_154;
  3521.    uint       Lin_ui_155;
  3522.    string     Lin_st_156;
  3523.    int        Lin_in_157;
  3524.    string     Lin_st_158;
  3525.    uint       Lin_ui_159;
  3526.    string     Lin_st_160;
  3527.    int        Lin_in_161;
  3528.    string     Lin_st_162;
  3529.    uint       Lin_ui_163;
  3530.    string     Lin_st_164;
  3531.    uint       Lin_ui_165;
  3532.    long       Lin_lo_166;
  3533.    int        Lin_in_167;
  3534.    string     Lin_st_168;
  3535.    uint       Lin_ui_169;
  3536.    string     Lin_st_170;
  3537.    int        Lin_in_171;
  3538.    string     Lin_st_172;
  3539.    uint       Lin_ui_173;
  3540.    string     Lin_st_174;
  3541.    int        Lin_in_175;
  3542.    string     Lin_st_176;
  3543.    uint       Lin_ui_177;
  3544.    string     Lin_st_178;
  3545.    uint       Lin_ui_179;
  3546.    long       Lin_lo_180;
  3547.    uint       Lin_ui_181;
  3548.    long       Lin_lo_182;
  3549.    uint       Lin_ui_183;
  3550.    long       Lin_lo_184;
  3551.    int        Lin_in_185;
  3552.    string     Lin_st_186;
  3553.    uint       Lin_ui_187;
  3554.    string     Lin_st_188;
  3555.    int        Lin_in_189;
  3556.    string     Lin_st_190;
  3557.    uint       Lin_ui_191;
  3558.    string     Lin_st_192;
  3559.    int        Lin_in_193;
  3560.    string     Lin_st_194;
  3561.    uint       Lin_ui_195;
  3562.    string     Lin_st_196;
  3563.    uint       Lin_ui_197;
  3564.    long       Lin_lo_198;
  3565.    int        Lin_in_199;
  3566.    string     Lin_st_200;
  3567.    uint       Lin_ui_201;
  3568.    string     Lin_st_202;
  3569.    int        Lin_in_203;
  3570.    string     Lin_st_204;
  3571.    uint       Lin_ui_205;
  3572.    string     Lin_st_206;
  3573.    int        Lin_in_207;
  3574.    string     Lin_st_208;
  3575.    uint       Lin_ui_209;
  3576.    string     Lin_st_210;
  3577.    uint       Lin_ui_211;
  3578.    long       Lin_lo_212;
  3579.    int        Lin_in_213;
  3580.    string     Lin_st_214;
  3581.    uint       Lin_ui_215;
  3582.    string     Lin_st_216;
  3583.    int        Lin_in_217;
  3584.    string     Lin_st_218;
  3585.    uint       Lin_ui_219;
  3586.    string     Lin_st_220;
  3587.    int        Lin_in_221;
  3588.    string     Lin_st_222;
  3589.    uint       Lin_ui_223;
  3590.    string     Lin_st_224;
  3591.    uint       Lin_ui_225;
  3592.    long       Lin_lo_226;
  3593.    int        Lin_in_227;
  3594.    string     Lin_st_228;
  3595.    uint       Lin_ui_229;
  3596.    string     Lin_st_230;
  3597.    int        Lin_in_231;
  3598.    string     Lin_st_232;
  3599.    uint       Lin_ui_233;
  3600.    string     Lin_st_234;
  3601.    int        Lin_in_235;
  3602.    string     Lin_st_236;
  3603.    int        Lin_in_237;
  3604.    uint       Lin_ui_238;
  3605.    string     Lin_st_239;
  3606.    int        Lin_in_240;
  3607.    string     Lin_st_241;
  3608.    uint       Lin_ui_242;
  3609.    string     Lin_st_243;
  3610.    int        Lin_in_244;
  3611.    string     Lin_st_245;
  3612.    uint       Lin_ui_246;
  3613.    string     Lin_st_247;
  3614.    int        Lin_in_248;
  3615.    string     Lin_st_249;
  3616.    int        Lin_in_250;
  3617.    uint       Lin_ui_251;
  3618.    string     Lin_st_252;
  3619.    int        Lin_in_253;
  3620.    string     Lin_st_254;
  3621.    uint       Lin_ui_255;
  3622.    string     Lin_st_256;
  3623.    int        Lin_in_257;
  3624.    string     Lin_st_258;
  3625.    uint       Lin_ui_259;
  3626.    string     Lin_st_260;
  3627.    int        Lin_in_261;
  3628.    string     Lin_st_262;
  3629.    int        Lin_in_263;
  3630.    uint       Lin_ui_264;
  3631.    string     Lin_st_265;
  3632.    uint       Lin_ui_266;
  3633.    long       Lin_lo_267;
  3634.    int        Lin_in_268;
  3635.    string     Lin_st_269;
  3636.    uint       Lin_ui_270;
  3637.    string     Lin_st_271;
  3638.    int        Lin_in_272;
  3639.    string     Lin_st_273;
  3640.    uint       Lin_ui_274;
  3641.    string     Lin_st_275;
  3642.    int        Lin_in_276;
  3643.    string     Lin_st_277;
  3644.    uint       Lin_ui_278;
  3645.    string     Lin_st_279;
  3646.    NowProfit=0;
  3647.    BuyAmount=0;
  3648.    SellAmount=0;
  3649.    Zi_1_st = "  " + AccountCurrency();
  3650.    Zi_2_in = 1 ;
  3651.    Zi_4_in = 110 ;
  3652.    Zi_5_do = 0.0 ;
  3653.     Lin_st_31 = (string)Magic;
  3654.       Lin_in_32 = TimeDay(GetSystemTime());
  3655.       Lin_in_33 = Lin_in_32;
  3656.       NowProfit = 0.0;
  3657.       Lin_lo_36 = StringToInteger(Lin_st_31);
  3658.       for(Lin_in_37 = HistoryTotal() - 1 ; Lin_in_37 >= 0 ; Lin_in_37 = Lin_in_37 - 1)
  3659.         {
  3660.          if(!(OrderSelect(Lin_in_37, 0, 1)))
  3661.             continue;
  3662.          Lin_in_38 = TimeDay(OrderCloseTime());
  3663.          if(Lin_in_38 != Lin_in_32)
  3664.             break;
  3665.          if((Lin_lo_36 != -1 && OrderMagicNumber() != Lin_lo_36))
  3666.             continue;
  3667.          NowProfit = OrderProfit() + OrderSwap() + OrderCommission() + NowProfit;
  3668.         }
  3669.    if(En_Console==false)
  3670.    return;
  3671.    if((toggle_console == true) && (Allow_Console==true))
  3672.      {
  3673.       Lin_ui_1 = Snow;
  3674.       Lin_lo_2 = 0;
  3675.       if(ObjectFind(0, Zong_17_st_D0 + "background") <  0)
  3676.         {
  3677.          ObjectCreate(0, Zong_17_st_D0 + "background", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  3678.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_XDISTANCE, 308+XDis_Diff);
  3679.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_YDISTANCE, 50);
  3680.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_XSIZE, 300);
  3681.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_YSIZE, 440);
  3682.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_BORDER_TYPE, 0);
  3683.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_CORNER, 1);
  3684.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_COLOR, 8421376);
  3685.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_STYLE, 0);
  3686.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_WIDTH, 10);
  3687.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_BACK, 0);
  3688.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_SELECTABLE, 0);
  3689.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_SELECTED, 0);
  3690.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_HIDDEN, 1);
  3691.          ObjectSetInteger(0, Zong_17_st_D0 + "background", OBJPROP_ZORDER, 0);
  3692.         }
  3693.       ObjectSetInteger(Lin_lo_2, Zong_17_st_D0 + "background", OBJPROP_BGCOLOR, Lin_ui_1);
  3694.       Lin_ui_3 = LightCyan;
  3695.       Lin_lo_4 = 0;
  3696.       if(ObjectFind(0, Zong_17_st_D0 + "showprofit") <  0)
  3697.         {
  3698.          ObjectCreate(0, Zong_17_st_D0 + "showprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  3699.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_XDISTANCE, 298+XDis_Diff);
  3700.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_YDISTANCE, 90);
  3701.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_XSIZE, 280);
  3702.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_YSIZE, 85);
  3703.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_BORDER_TYPE, 0);
  3704.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_CORNER, 1);
  3705.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_COLOR, 8421376);
  3706.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_STYLE, 0);
  3707.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_WIDTH, 1);
  3708.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_BACK, 0);
  3709.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_SELECTABLE, 0);
  3710.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_SELECTED, 0);
  3711.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_HIDDEN, 1);
  3712.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofit", OBJPROP_ZORDER, 0);
  3713.         }
  3714.       ObjectSetInteger(Lin_lo_4, Zong_17_st_D0 + "showprofit", OBJPROP_BGCOLOR, Lin_ui_3);
  3715.       Lin_ui_5 = LightCyan;
  3716.       Lin_lo_6 = 0;
  3717.       if(ObjectFind(0, Zong_17_st_D0 + "showprofittitle") <  0)
  3718.         {
  3719.          ObjectCreate(0, Zong_17_st_D0 + "showprofittitle", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  3720.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_XDISTANCE, 213+XDis_Diff);
  3721.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_YDISTANCE, 80);
  3722.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_XSIZE, 120);
  3723.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_YSIZE, 20);
  3724.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_BORDER_TYPE, 0);
  3725.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_CORNER, 1);
  3726.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_COLOR, 8421376);
  3727.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_STYLE, 0);
  3728.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_WIDTH, 1);
  3729.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_BACK, 0);
  3730.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_SELECTABLE, 0);
  3731.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_SELECTED, 0);
  3732.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_HIDDEN, 1);
  3733.          ObjectSetInteger(0, Zong_17_st_D0 + "showprofittitle", OBJPROP_ZORDER, 0);
  3734.         }
  3735.       ObjectSetInteger(Lin_lo_6, Zong_17_st_D0 + "showprofittitle", OBJPROP_BGCOLOR, Lin_ui_5);
  3736.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "B" ;
  3737.       if(Zong_25_bo_114 == true)
  3738.         {
  3739.          Lin_in_7 = Zong_19_in_EC;
  3740.          Lin_st_8 = Zong_21_st_F8;
  3741.          Lin_ui_9 = Green;
  3742.          Lin_st_10 = "Enable Buy";
  3743.          if(ObjectFind(Zi_3_st) == -1)
  3744.            {
  3745.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3746.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3747.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  3748.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, 65);
  3749.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3750.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3751.            }
  3752.          ObjectSetText(Zi_3_st, Lin_st_10, Lin_in_7, Lin_st_8, Lin_ui_9);
  3753.         }
  3754.       else
  3755.         {
  3756.          Lin_in_11 = Zong_19_in_EC;
  3757.          Lin_st_12 = Zong_21_st_F8;
  3758.          Lin_ui_13 = Tomato;
  3759.          Lin_st_14 = "Disable Buy";
  3760.          if(ObjectFind(Zi_3_st) == -1)
  3761.            {
  3762.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3763.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3764.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  3765.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, 65);
  3766.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3767.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3768.            }
  3769.          ObjectSetText(Zi_3_st, Lin_st_14, Lin_in_11, Lin_st_12, Lin_ui_13);
  3770.         }
  3771.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "S" ;
  3772.       if(Zong_26_bo_115 == true)
  3773.         {
  3774.          Lin_in_15 = Zong_19_in_EC;
  3775.          Lin_st_16 = Zong_21_st_F8;
  3776.          Lin_ui_17 = Green;
  3777.          Lin_st_18 = "Enable Sell";
  3778.          if(ObjectFind(Zi_3_st) == -1)
  3779.            {
  3780.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3781.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3782.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 40+XDis_Diff);
  3783.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, 65);
  3784.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3785.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3786.            }
  3787.          ObjectSetText(Zi_3_st, Lin_st_18, Lin_in_15, Lin_st_16, Lin_ui_17);
  3788.         }
  3789.       else
  3790.         {
  3791.          Lin_in_19 = Zong_19_in_EC;
  3792.          Lin_st_20 = Zong_21_st_F8;
  3793.          Lin_ui_21 = Tomato;
  3794.          Lin_st_22 = "Disable Sell";
  3795.          if(ObjectFind(Zi_3_st) == -1)
  3796.            {
  3797.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3798.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3799.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 40+XDis_Diff);
  3800.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, 65);
  3801.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3802.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3803.            }
  3804.          ObjectSetText(Zi_3_st, Lin_st_22, Lin_in_19, Lin_st_20, Lin_ui_21);
  3805.         }
  3806.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "N" ;
  3807.       Lin_in_23 = Zong_19_in_EC;
  3808.       Lin_st_24 = Zong_21_st_F8;
  3809.       Lin_ui_25 = 0;
  3810.       Lin_st_26 = "Profit Statistics";
  3811.       if(ObjectFind(Zi_3_st) == -1)
  3812.         {
  3813.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3814.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3815.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 122+XDis_Diff);
  3816.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, 80);
  3817.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3818.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3819.         }
  3820.       ObjectSetText(Zi_3_st, Lin_st_26, Lin_in_23, Lin_st_24, Lin_ui_25);
  3821.       Zi_2_in ++;
  3822.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "N" ;
  3823.       Lin_in_27 = Zong_19_in_EC;
  3824.       Lin_st_28 = "Microsoft YaHei";
  3825.       Lin_ui_29 = 0;
  3826.       Lin_st_30 = "Now Profit:";
  3827.       if(ObjectFind(Zi_3_st) == -1)
  3828.         {
  3829.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3830.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3831.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  3832.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3833.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3834.          ObjectSetString(0, Zi_3_st, 1001, "Microsoft YaHei");
  3835.         }
  3836.       ObjectSetText(Zi_3_st, Lin_st_30, Lin_in_27, Lin_st_28, Lin_ui_29);
  3837.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "V" ;
  3838.       Lin_do_34 = NormalizeDouble(NowProfit, 2);
  3839.       Zi_5_do = Lin_do_34 ;
  3840.       Lin_in_39 = Zong_19_in_EC;
  3841.       Lin_st_40 = Zong_21_st_F8;
  3842.       Lin_in_41 = Zong_22_in_104;
  3843.       Lin_ui_42 = (Zi_5_do >= 0.0) ? 25600 : 3937500 ;
  3844.       Lin_st_43 = DoubleToString(Zi_5_do, 2) + Zi_1_st;
  3845.       if(ObjectFind(Zi_3_st) == -1)
  3846.         {
  3847.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3848.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_41);
  3849.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 100+XDis_Diff);
  3850.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3851.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3852.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_40);
  3853.         }
  3854.       ObjectSetText(Zi_3_st, Lin_st_43, Lin_in_39, Lin_st_40, Lin_ui_42);
  3855.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "P" ;
  3856.       Lin_in_44 = Zong_19_in_EC;
  3857.       Lin_st_45 = Zong_21_st_F8;
  3858.       Lin_in_46 = Zong_22_in_104;
  3859.       Lin_ui_47 = (Zi_5_do >= 0.0) ? 25600 : 3937500 ;
  3860.       Lin_st_48 = DoubleToString(Zi_5_do / Zong_23_do_108 * 100.0, 2) + "%";
  3861.       if(ObjectFind(Zi_3_st) == -1)
  3862.         {
  3863.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3864.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_46);
  3865.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 25+XDis_Diff);
  3866.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3867.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3868.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_45);
  3869.         }
  3870.       ObjectSetText(Zi_3_st, Lin_st_48, Lin_in_44, Lin_st_45, Lin_ui_47);
  3871.       Zi_2_in ++;
  3872.       Zi_4_in += Zong_19_in_EC * 2;
  3873.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "N" ;
  3874.       Lin_in_49 = Zong_19_in_EC;
  3875.       Lin_st_50 = Zong_21_st_F8;
  3876.       Lin_ui_51 = 0;
  3877.       Lin_st_52 = "Old Profit:";
  3878.       if(ObjectFind(Zi_3_st) == -1)
  3879.         {
  3880.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3881.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3882.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  3883.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3884.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3885.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3886.         }
  3887.       ObjectSetText(Zi_3_st, Lin_st_52, Lin_in_49, Lin_st_50, Lin_ui_51);
  3888.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "V" ;
  3889.       Lin_st_53 = (string)Magic;
  3890.       Lin_in_54 = 0;
  3891.       Lin_in_55 = 0;
  3892.       switch(1)
  3893.         {
  3894.          case 0 :
  3895.             Lin_in_54 = TimeDay(GetSystemTime());
  3896.             Lin_in_55 = Lin_in_54;
  3897.             break;
  3898.          case 1 :
  3899.             Lin_in_54 = Lin_in_55 - 1;
  3900.             Lin_in_55 = Lin_in_54;
  3901.             break;
  3902.          case 2 :
  3903.             Lin_in_54 = 0;
  3904.             Lin_in_55 = 999999;
  3905.             break;
  3906.          default :
  3907.             Lin_do_56 = 0.0;
  3908.             break;
  3909.         }
  3910.       Lin_do_57 = 0.0;
  3911.       if(Lin_st_53 == "")
  3912.         {
  3913.          Lin_lo_58 = -1;
  3914.         }
  3915.       else
  3916.         {
  3917.          Lin_lo_58 = StringToInteger(Lin_st_53);
  3918.         }
  3919.       Lin_lo_58 = Lin_lo_58;
  3920.       for(Lin_in_59 = HistoryTotal() - 1 ; Lin_in_59 >= 0 ; Lin_in_59 = Lin_in_59 - 1)
  3921.         {
  3922.          if(!(OrderSelect(Lin_in_59, 0, 1)))
  3923.             continue;
  3924.          Lin_in_60 = TimeDay(OrderCloseTime());
  3925.          if(Lin_in_60 < Lin_in_54 || Lin_in_60 > Lin_in_55)
  3926.             continue;
  3927.          if((Lin_lo_58 != -1 && OrderMagicNumber() != Lin_lo_58))
  3928.             continue;
  3929.          Lin_do_57 = OrderProfit() + OrderSwap() + OrderCommission() + Lin_do_57;
  3930.         }
  3931.       Lin_do_56 = NormalizeDouble(Lin_do_57, 2);
  3932.       Zi_5_do = Lin_do_56 ;
  3933.       Lin_in_61 = Zong_19_in_EC;
  3934.       Lin_st_62 = Zong_21_st_F8;
  3935.       Lin_in_63 = Zong_22_in_104;
  3936.       Lin_ui_64 = (Zi_5_do >= 0.0) ? 25600 : 3937500 ;
  3937.       Lin_st_65 = DoubleToString(Zi_5_do, 2) + Zi_1_st;
  3938.       if(ObjectFind(Zi_3_st) == -1)
  3939.         {
  3940.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3941.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_63);
  3942.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 100+XDis_Diff);
  3943.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3944.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3945.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_62);
  3946.         }
  3947.       ObjectSetText(Zi_3_st, Lin_st_65, Lin_in_61, Lin_st_62, Lin_ui_64);
  3948.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "P" ;
  3949.       Lin_in_66 = Zong_19_in_EC;
  3950.       Lin_st_67 = Zong_21_st_F8;
  3951.       Lin_in_68 = Zong_22_in_104;
  3952.       Lin_ui_69 = (Zi_5_do >= 0.0) ? 25600 : 3937500 ;
  3953.       Lin_st_70 = DoubleToString(Zi_5_do / Zong_23_do_108 * 100.0, 2) + "%";
  3954.       if(ObjectFind(Zi_3_st) == -1)
  3955.         {
  3956.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3957.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_68);
  3958.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 25+XDis_Diff);
  3959.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3960.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3961.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_67);
  3962.         }
  3963.       ObjectSetText(Zi_3_st, Lin_st_70, Lin_in_66, Lin_st_67, Lin_ui_69);
  3964.       Zi_2_in ++;
  3965.       Zi_4_in += Zong_19_in_EC * 2;
  3966.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "N" ;
  3967.       Lin_in_71 = Zong_19_in_EC;
  3968.       Lin_st_72 = Zong_21_st_F8;
  3969.       Lin_ui_73 = 0;
  3970.       Lin_st_74 = "Total Profit:";
  3971.       if(ObjectFind(Zi_3_st) == -1)
  3972.         {
  3973.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  3974.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  3975.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  3976.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  3977.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  3978.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  3979.         }
  3980.       ObjectSetText(Zi_3_st, Lin_st_74, Lin_in_71, Lin_st_72, Lin_ui_73);
  3981.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "V" ;
  3982.       Lin_st_75 = (string)Magic;
  3983.       Lin_in_76 = 0;
  3984.       Lin_in_77 = 0;
  3985.       switch(2)
  3986.         {
  3987.          case 0 :
  3988.             Lin_in_76 = TimeDay(GetSystemTime());
  3989.             Lin_in_77 = Lin_in_76;
  3990.             break;
  3991.          case 1 :
  3992.             Lin_in_76 = Lin_in_77 - 1;
  3993.             Lin_in_77 = Lin_in_76;
  3994.             break;
  3995.          case 2 :
  3996.             Lin_in_76 = 0;
  3997.             Lin_in_77 = 999999;
  3998.             break;
  3999.          default :
  4000.             Lin_do_78 = 0.0;
  4001.             break;
  4002.         }
  4003.       Lin_do_79 = 0.0;
  4004.       if(Lin_st_75 == "")
  4005.         {
  4006.          Lin_lo_80 = -1;
  4007.         }
  4008.       else
  4009.         {
  4010.          Lin_lo_80 = StringToInteger(Lin_st_75);
  4011.         }
  4012.       Lin_lo_80 = Lin_lo_80;
  4013.       for(Lin_in_81 = HistoryTotal() - 1 ; Lin_in_81 >= 0 ; Lin_in_81 = Lin_in_81 - 1)
  4014.         {
  4015.          if(!(OrderSelect(Lin_in_81, 0, 1)))
  4016.             continue;
  4017.          Lin_in_82 = TimeDay(OrderCloseTime());
  4018.          if(Lin_in_82 < Lin_in_76 || Lin_in_82 > Lin_in_77)
  4019.             continue;
  4020.          if((Lin_lo_80 != -1 && OrderMagicNumber() != Lin_lo_80))
  4021.             continue;
  4022.          Lin_do_79 = OrderProfit() + OrderSwap() + OrderCommission() + Lin_do_79;
  4023.         }
  4024.       Lin_do_78 = NormalizeDouble(Lin_do_79, 2);
  4025.       Zi_5_do = Lin_do_78 ;
  4026.       Lin_in_83 = Zong_19_in_EC;
  4027.       Lin_st_84 = Zong_21_st_F8;
  4028.       Lin_in_85 = Zong_22_in_104;
  4029.       Lin_ui_86 = (Zi_5_do >= 0.0) ? 25600 : 3937500 ;
  4030.       Lin_st_87 = DoubleToString(Zi_5_do, 2) + Zi_1_st;
  4031.       if(ObjectFind(Zi_3_st) == -1)
  4032.         {
  4033.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4034.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_85);
  4035.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 100+XDis_Diff);
  4036.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4037.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4038.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_84);
  4039.         }
  4040.       ObjectSetText(Zi_3_st, Lin_st_87, Lin_in_83, Lin_st_84, Lin_ui_86);
  4041.       Zi_3_st = Zong_17_st_D0 + string(Zi_2_in) + "P" ;
  4042.       Lin_in_88 = Zong_19_in_EC;
  4043.       Lin_st_89 = Zong_21_st_F8;
  4044.       Lin_in_90 = Zong_22_in_104;
  4045.       Lin_ui_91 = (Zi_5_do >= 0.0) ? 25600 : 3937500 ;
  4046.       Lin_st_92 = DoubleToString(Zi_5_do / Zong_23_do_108 * 100.0, 2) + "%";
  4047.       if(ObjectFind(Zi_3_st) == -1)
  4048.         {
  4049.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4050.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_90);
  4051.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 25+XDis_Diff);
  4052.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4053.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4054.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_89);
  4055.         }
  4056.       ObjectSetText(Zi_3_st, Lin_st_92, Lin_in_88, Lin_st_89, Lin_ui_91);
  4057.       Zi_4_in += Zong_19_in_EC * 3;
  4058.       Zi_3_st = Zong_17_st_D0 + "Balance" + "N" ;
  4059.       Lin_in_93 = Zong_19_in_EC;
  4060.       Lin_st_94 = Zong_21_st_F8;
  4061.       Lin_ui_95 = Teal;
  4062.       Lin_st_96 = "Balance:";
  4063.       if(ObjectFind(Zi_3_st) == -1)
  4064.         {
  4065.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4066.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4067.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  4068.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4069.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4070.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4071.         }
  4072.       ObjectSetText(Zi_3_st, Lin_st_96, Lin_in_93, Lin_st_94, Lin_ui_95);
  4073.       Zi_3_st = Zong_17_st_D0 + "Balance" + "V" ;
  4074.       Lin_in_97 = Zong_19_in_EC;
  4075.       Lin_st_98 = Zong_21_st_F8;
  4076.       Lin_ui_99 = Teal;
  4077.       Lin_st_100 = DoubleToString(AccountBalance(), 2) + Zi_1_st;
  4078.       if(ObjectFind(Zi_3_st) == -1)
  4079.         {
  4080.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4081.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4082.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 80+XDis_Diff);
  4083.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4084.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4085.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4086.         }
  4087.       ObjectSetText(Zi_3_st, Lin_st_100, Lin_in_97, Lin_st_98, Lin_ui_99);
  4088.       Zi_2_in ++;
  4089.       Zi_4_in += Zong_19_in_EC * 2;
  4090.       Zi_3_st = Zong_17_st_D0 + "Equity" + "N" ;
  4091.       Lin_in_101 = Zong_19_in_EC;
  4092.       Lin_st_102 = Zong_21_st_F8;
  4093.       Lin_ui_103 = Teal;
  4094.       Lin_st_104 = "NET Value:";
  4095.       if(ObjectFind(Zi_3_st) == -1)
  4096.         {
  4097.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4098.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4099.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 230+XDis_Diff);
  4100.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4101.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4102.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4103.         }
  4104.       ObjectSetText(Zi_3_st, Lin_st_104, Lin_in_101, Lin_st_102, Lin_ui_103);
  4105.       Zi_3_st = Zong_17_st_D0 + "Equity" + "V" ;
  4106.       Lin_in_105 = Zong_19_in_EC;
  4107.       Lin_st_106 = Zong_21_st_F8;
  4108.       Lin_ui_107 = Green;
  4109.       Lin_st_108 = DoubleToString(AccountEquity(), 2) + Zi_1_st;
  4110.       if(ObjectFind(Zi_3_st) == -1)
  4111.         {
  4112.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4113.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4114.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 80+XDis_Diff);
  4115.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4116.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4117.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4118.         }
  4119.       ObjectSetText(Zi_3_st, Lin_st_108, Lin_in_105, Lin_st_106, Lin_ui_107);
  4120.       Zi_2_in ++;
  4121.       Zi_4_in += Zong_19_in_EC * 2;
  4122.       Zi_3_st = Zong_17_st_D0 + "MarginLevel" + "N" ;
  4123.       Lin_in_109 = Zong_19_in_EC;
  4124.       Lin_st_110 = Zong_21_st_F8;
  4125.       Lin_ui_111 = Teal;
  4126.       Lin_st_112 = "Margin Level:";
  4127.       if(ObjectFind(Zi_3_st) == -1)
  4128.         {
  4129.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4130.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4131.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 218+XDis_Diff);
  4132.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4133.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4134.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4135.         }
  4136.       ObjectSetText(Zi_3_st, Lin_st_112, Lin_in_109, Lin_st_110, Lin_ui_111);
  4137.       Zi_3_st = Zong_17_st_D0 + "MarginLevel" + "V" ;
  4138.       if(AccountMargin() == 0.0)
  4139.         {
  4140.          Lin_in_113 = Zong_19_in_EC;
  4141.          Lin_st_114 = Zong_21_st_F8;
  4142.          Lin_ui_115 = DarkBlue;
  4143.          Lin_st_116 = "0.00%";
  4144.          if(ObjectFind(Zi_3_st) == -1)
  4145.            {
  4146.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4147.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4148.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 80+XDis_Diff);
  4149.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4150.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4151.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4152.            }
  4153.          ObjectSetText(Zi_3_st, Lin_st_116, Lin_in_113, Lin_st_114, Lin_ui_115);
  4154.         }
  4155.       else
  4156.         {
  4157.          Lin_in_117 = Zong_19_in_EC;
  4158.          Lin_st_118 = Zong_21_st_F8;
  4159.          Lin_ui_119 = DarkBlue;
  4160.          Lin_st_120 = DoubleToString(AccountEquity() / AccountMargin() * 100.0, 2) + "%";
  4161.          if(ObjectFind(Zi_3_st) == -1)
  4162.            {
  4163.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4164.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4165.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 80+XDis_Diff);
  4166.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4167.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4168.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4169.            }
  4170.          ObjectSetText(Zi_3_st, Lin_st_120, Lin_in_117, Lin_st_118, Lin_ui_119);
  4171.         }
  4172.       Lin_st_121 = "Lot";
  4173.       Lin_in_122 = 0;
  4174.       Lin_do_123 = 0.0;
  4175.       for(Lin_in_124 = OrdersTotal() - 1 ; Lin_in_124 >= 0 ; Lin_in_124 = Lin_in_124 - 1)
  4176.         {
  4177.          bool res = OrderSelect(Lin_in_124, 0, 0);
  4178.          if(OrderSymbol() != Symbol() || OrderMagicNumber() != Magic || OrderType() != Lin_in_122)
  4179.             continue;
  4180.          if(Lin_st_121 == "Profit")
  4181.            {
  4182.             Lin_do_123 = Lin_do_123 + OrderProfit() - OrderSwap() - OrderCommission();
  4183.            }
  4184.          if(Lin_st_121 != "Lot")
  4185.             continue;
  4186.          Lin_do_123 = Lin_do_123 + OrderLots();
  4187.         }
  4188.       Zi_6_do = Lin_do_123 ;
  4189.       Lin_st_125 = "Lot";
  4190.       Lin_in_126 = 1;
  4191.       Lin_do_127 = 0.0;
  4192.       for(Lin_in_128 = OrdersTotal() - 1 ; Lin_in_128 >= 0 ; Lin_in_128 = Lin_in_128 - 1)
  4193.         {
  4194.          bool res = OrderSelect(Lin_in_128, 0, 0);
  4195.          if(OrderSymbol() != Symbol() || OrderMagicNumber() != Magic || OrderType() != Lin_in_126)
  4196.             continue;
  4197.          if(Lin_st_125 == "Profit")
  4198.            {
  4199.             Lin_do_127 = Lin_do_127 + OrderProfit() - OrderSwap() - OrderCommission();
  4200.            }
  4201.          if(Lin_st_125 != "Lot")
  4202.             continue;
  4203.          Lin_do_127 = Lin_do_127 + OrderLots();
  4204.         }
  4205.       Zi_7_do = Lin_do_127 ;
  4206.       Lin_st_129 = "Profit";
  4207.       Lin_in_130 = 0;
  4208.       Lin_do_131 = 0.0;
  4209.       for(Lin_in_132 = OrdersTotal() - 1 ; Lin_in_132 >= 0 ; Lin_in_132 = Lin_in_132 - 1)
  4210.         {
  4211.          bool res = OrderSelect(Lin_in_132, 0, 0);
  4212.          if(OrderSymbol() != Symbol() || OrderMagicNumber() != Magic || OrderType() != Lin_in_130)
  4213.             continue;
  4214.          if(Lin_st_129 == "Profit")
  4215.            {
  4216.             Lin_do_131 = Lin_do_131 + OrderProfit() - OrderSwap() - OrderCommission();
  4217.            }
  4218.          if(Lin_st_129 != "Lot")
  4219.             continue;
  4220.          Lin_do_131 = Lin_do_131 + OrderLots();
  4221.         }
  4222.       BuyAmount = Lin_do_131 ;
  4223.       Lin_st_133 = "Profit";
  4224.       Lin_in_134 = 1;
  4225.       Lin_do_135 = 0.0;
  4226.       for(Lin_in_136 = OrdersTotal() - 1 ; Lin_in_136 >= 0 ; Lin_in_136 = Lin_in_136 - 1)
  4227.         {
  4228.          bool res = OrderSelect(Lin_in_136, 0, 0);
  4229.          if(OrderSymbol() != Symbol() || OrderMagicNumber() != Magic || OrderType() != Lin_in_134)
  4230.             continue;
  4231.          if(Lin_st_133 == "Profit")
  4232.            {
  4233.             Lin_do_135 = Lin_do_135 + OrderProfit() - OrderSwap() - OrderCommission();
  4234.            }
  4235.          if(Lin_st_133 != "Lot")
  4236.             continue;
  4237.          Lin_do_135 = Lin_do_135 + OrderLots();
  4238.         }
  4239.       SellAmount = Lin_do_135 ;
  4240.       Zi_4_in += Zong_19_in_EC * 2;
  4241.       Lin_ui_137 = MistyRose;
  4242.       Lin_lo_138 = 0;
  4243.       if(ObjectFind(0, Zong_17_st_D0 + "showtotalprofit") <  0)
  4244.         {
  4245.          ObjectCreate(0, Zong_17_st_D0 + "showtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4246.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4247.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4248.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XSIZE, 171);
  4249.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YSIZE, 60);
  4250.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4251.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_CORNER, 1);
  4252.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_COLOR, 8421376);
  4253.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_STYLE, 0);
  4254.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_WIDTH, 1);
  4255.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BACK, 0);
  4256.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTABLE, 0);
  4257.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTED, 0);
  4258.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_HIDDEN, 1);
  4259.          ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_ZORDER, 0);
  4260.         }
  4261.       ObjectSetInteger(Lin_lo_138, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BGCOLOR, Lin_ui_137);
  4262.       Zi_4_in += Zong_19_in_EC * 2;
  4263.       Zi_3_st = Zong_17_st_D0 + "TotalProfit" + "N" ;
  4264.       Zi_10_st = Zong_17_st_D0 + "TotalProfit" + "V" ;
  4265.       Zi_11_st = Zong_17_st_D0 + "TotalProfit" + "P" ;
  4266.       if(Zi_6_do == 0.0 && Zi_7_do == 0.0)
  4267.         {
  4268.          Lin_in_139 = int(Zong_19_in_EC * 1.5);
  4269.          Lin_st_140 = Zong_21_st_F8;
  4270.          Lin_ui_141 = Teal;
  4271.          Lin_st_142 = "A/C empty:";
  4272.          if(ObjectFind(Zi_3_st) == -1)
  4273.            {
  4274.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4275.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4276.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 188+XDis_Diff);
  4277.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4278.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4279.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4280.            }
  4281.          ObjectSetText(Zi_3_st, Lin_st_142, Lin_in_139, Lin_st_140, Lin_ui_141);
  4282.          Lin_in_143 = Zong_19_in_EC;
  4283.          Lin_st_144 = Zong_21_st_F8;
  4284.          Lin_ui_145 = Teal;
  4285.          Lin_st_146 = "0.00[        DISCUZ_CODE_0        ]quot;;
  4286.          if(ObjectFind(Zi_10_st) == -1)
  4287.            {
  4288.             ObjectCreate(Zi_10_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4289.             ObjectSet(Zi_10_st, OBJPROP_CORNER, Zong_22_in_104);
  4290.             ObjectSet(Zi_10_st, OBJPROP_XDISTANCE, 35+XDis_Diff);
  4291.             ObjectSet(Zi_10_st, OBJPROP_YDISTANCE, Zi_4_in - Zong_19_in_EC);
  4292.             ObjectSet(Zi_10_st, OBJPROP_BACK, 0.0);
  4293.             ObjectSetString(0, Zi_10_st, 1001, Zong_21_st_F8);
  4294.            }
  4295.          ObjectSetText(Zi_10_st, Lin_st_146, Lin_in_143, Lin_st_144, Lin_ui_145);
  4296.          Lin_in_147 = Zong_19_in_EC;
  4297.          Lin_st_148 = Zong_21_st_F8;
  4298.          Lin_ui_149 = Teal;
  4299.          Lin_st_150 = "0.00%";
  4300.          if(ObjectFind(Zi_11_st) == -1)
  4301.            {
  4302.             ObjectCreate(Zi_11_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4303.             ObjectSet(Zi_11_st, OBJPROP_CORNER, Zong_22_in_104);
  4304.             ObjectSet(Zi_11_st, OBJPROP_XDISTANCE, 50+XDis_Diff);
  4305.             ObjectSet(Zi_11_st, OBJPROP_YDISTANCE, Zi_4_in + Zong_19_in_EC * 2);
  4306.             ObjectSet(Zi_11_st, OBJPROP_BACK, 0.0);
  4307.             ObjectSetString(0, Zi_11_st, 1001, Zong_21_st_F8);
  4308.            }
  4309.          ObjectSetText(Zi_11_st, Lin_st_150, Lin_in_147, Lin_st_148, Lin_ui_149);
  4310.          ObjectSetText(Zi_3_st, "A/C empty:", int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Teal);
  4311.          ObjectSetText(Zi_10_st, "0.00[        DISCUZ_CODE_0        ]quot;, int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Teal);
  4312.          Lin_ui_151 = Snow;
  4313.          Lin_lo_152 = 0;
  4314.          if(ObjectFind(0, Zong_17_st_D0 + "showtotalprofit") <  0)
  4315.            {
  4316.             ObjectCreate(0, Zong_17_st_D0 + "showtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4317.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4318.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4319.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XSIZE, 171);
  4320.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YSIZE, 60);
  4321.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4322.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_CORNER, 1);
  4323.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_COLOR, 8421376);
  4324.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_STYLE, 0);
  4325.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_WIDTH, 1);
  4326.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BACK, 0);
  4327.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTABLE, 0);
  4328.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTED, 0);
  4329.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_HIDDEN, 1);
  4330.             ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_ZORDER, 0);
  4331.            }
  4332.          ObjectSetInteger(Lin_lo_152, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BGCOLOR, Lin_ui_151);
  4333.         }
  4334.       else
  4335.         {
  4336.          if(AccountProfit() > 0.0)
  4337.            {
  4338.             Lin_in_153 = int(Zong_19_in_EC * 1.5);
  4339.             Lin_st_154 = Zong_21_st_F8;
  4340.             Lin_ui_155 = DarkGreen;
  4341.             Lin_st_156 = "A/C Profit:";
  4342.             if(ObjectFind(Zi_3_st) == -1)
  4343.               {
  4344.                ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4345.                ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4346.                ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 188+XDis_Diff);
  4347.                ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4348.                ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4349.                ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4350.               }
  4351.             ObjectSetText(Zi_3_st, Lin_st_156, Lin_in_153, Lin_st_154, Lin_ui_155);
  4352.             Lin_in_157 = Zong_19_in_EC;
  4353.             Lin_st_158 = Zong_21_st_F8;
  4354.             Lin_ui_159 = DarkGreen;
  4355.             Lin_st_160 = DoubleToString(AccountProfit(), 2) + "[        DISCUZ_CODE_0        ]quot;;
  4356.             if(ObjectFind(Zi_10_st) == -1)
  4357.               {
  4358.                ObjectCreate(Zi_10_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4359.                ObjectSet(Zi_10_st, OBJPROP_CORNER, Zong_22_in_104);
  4360.                ObjectSet(Zi_10_st, OBJPROP_XDISTANCE, 30+XDis_Diff);
  4361.                ObjectSet(Zi_10_st, OBJPROP_YDISTANCE, Zi_4_in - Zong_19_in_EC);
  4362.                ObjectSet(Zi_10_st, OBJPROP_BACK, 0.0);
  4363.                ObjectSetString(0, Zi_10_st, 1001, Zong_21_st_F8);
  4364.               }
  4365.             ObjectSetText(Zi_10_st, Lin_st_160, Lin_in_157, Lin_st_158, Lin_ui_159);
  4366.             Lin_in_161 = Zong_19_in_EC;
  4367.             Lin_st_162 = Zong_21_st_F8;
  4368.             Lin_ui_163 = DarkGreen;
  4369.             Lin_st_164 = DoubleToString(AccountProfit() / Zong_23_do_108 * 100.0, 2) + "%";
  4370.             if(ObjectFind(Zi_11_st) == -1)
  4371.               {
  4372.                ObjectCreate(Zi_11_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4373.                ObjectSet(Zi_11_st, OBJPROP_CORNER, Zong_22_in_104);
  4374.                ObjectSet(Zi_11_st, OBJPROP_XDISTANCE, 50+XDis_Diff);
  4375.                ObjectSet(Zi_11_st, OBJPROP_YDISTANCE, Zi_4_in + Zong_19_in_EC * 2);
  4376.                ObjectSet(Zi_11_st, OBJPROP_BACK, 0.0);
  4377.                ObjectSetString(0, Zi_11_st, 1001, Zong_21_st_F8);
  4378.               }
  4379.             ObjectSetText(Zi_11_st, Lin_st_164, Lin_in_161, Lin_st_162, Lin_ui_163);
  4380.             ObjectSetText(Zi_3_st, "A/C Profit:", int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Brown);
  4381.             ObjectSetText(Zi_10_st, DoubleToString(AccountProfit(), 2) + "[        DISCUZ_CODE_0        ]quot;, int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Brown);
  4382.             Lin_ui_165 = Honeydew;
  4383.             Lin_lo_166 = 0;
  4384.             if(ObjectFind(0, Zong_17_st_D0 + "showtotalprofit") <  0)
  4385.               {
  4386.                ObjectCreate(0, Zong_17_st_D0 + "showtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4387.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4388.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4389.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XSIZE, 171);
  4390.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YSIZE, 60);
  4391.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4392.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_CORNER, 1);
  4393.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_COLOR, 8421376);
  4394.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_STYLE, 0);
  4395.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_WIDTH, 1);
  4396.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BACK, 0);
  4397.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTABLE, 0);
  4398.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTED, 0);
  4399.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_HIDDEN, 1);
  4400.                ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_ZORDER, 0);
  4401.               }
  4402.             ObjectSetInteger(Lin_lo_166, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BGCOLOR, Lin_ui_165);
  4403.            }
  4404.          else
  4405.            {
  4406.             if(AccountProfit() < 0.0)
  4407.               {
  4408.                Lin_in_167 = int(Zong_19_in_EC * 1.5);
  4409.                Lin_st_168 = Zong_21_st_F8;
  4410.                Lin_ui_169 = Brown;
  4411.                Lin_st_170 = "A/C Loss:";
  4412.                if(ObjectFind(Zi_3_st) == -1)
  4413.                  {
  4414.                   ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4415.                   ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4416.                   ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 188+XDis_Diff);
  4417.                   ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4418.                   ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4419.                   ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4420.                  }
  4421.                ObjectSetText(Zi_3_st, Lin_st_170, Lin_in_167, Lin_st_168, Lin_ui_169);
  4422.                Lin_in_171 = Zong_19_in_EC;
  4423.                Lin_st_172 = Zong_21_st_F8;
  4424.                Lin_ui_173 = Brown;
  4425.                Lin_st_174 = DoubleToString(AccountProfit(), 2) + "[        DISCUZ_CODE_0        ]quot;;
  4426.                if(ObjectFind(Zi_10_st) == -1)
  4427.                  {
  4428.                   ObjectCreate(Zi_10_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4429.                   ObjectSet(Zi_10_st, OBJPROP_CORNER, Zong_22_in_104);
  4430.                   ObjectSet(Zi_10_st, OBJPROP_XDISTANCE, 30+XDis_Diff);
  4431.                   ObjectSet(Zi_10_st, OBJPROP_YDISTANCE, Zi_4_in - Zong_19_in_EC);
  4432.                   ObjectSet(Zi_10_st, OBJPROP_BACK, 0.0);
  4433.                   ObjectSetString(0, Zi_10_st, 1001, Zong_21_st_F8);
  4434.                  }
  4435.                ObjectSetText(Zi_10_st, Lin_st_174, Lin_in_171, Lin_st_172, Lin_ui_173);
  4436.                Lin_in_175 = Zong_19_in_EC;
  4437.                Lin_st_176 = Zong_21_st_F8;
  4438.                Lin_ui_177 = Brown;
  4439.                Lin_st_178 = DoubleToString(AccountProfit() / Zong_23_do_108 * 100.0, 2) + "%";
  4440.                if(ObjectFind(Zi_11_st) == -1)
  4441.                  {
  4442.                   ObjectCreate(Zi_11_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4443.                   ObjectSet(Zi_11_st, OBJPROP_CORNER, Zong_22_in_104);
  4444.                   ObjectSet(Zi_11_st, OBJPROP_XDISTANCE, 50+XDis_Diff);
  4445.                   ObjectSet(Zi_11_st, OBJPROP_YDISTANCE, Zi_4_in + Zong_19_in_EC * 2);
  4446.                   ObjectSet(Zi_11_st, OBJPROP_BACK, 0.0);
  4447.                   ObjectSetString(0, Zi_11_st, 1001, Zong_21_st_F8);
  4448.                  }
  4449.                ObjectSetText(Zi_11_st, Lin_st_178, Lin_in_175, Lin_st_176, Lin_ui_177);
  4450.                ObjectSetText(Zi_3_st, "A/C Loss:", int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Crimson);
  4451.                ObjectSetText(Zi_10_st, DoubleToString(AccountProfit(), 2) + "[        DISCUZ_CODE_0        ]quot;, int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Crimson);
  4452.                Lin_ui_179 = MistyRose;
  4453.                Lin_lo_180 = 0;
  4454.                if(ObjectFind(0, Zong_17_st_D0 + "showtotalprofit") <  0)
  4455.                  {
  4456.                   ObjectCreate(0, Zong_17_st_D0 + "showtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4457.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4458.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4459.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_XSIZE, 171);
  4460.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_YSIZE, 60);
  4461.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4462.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_CORNER, 1);
  4463.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_COLOR, 8421376);
  4464.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_STYLE, 0);
  4465.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_WIDTH, 1);
  4466.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BACK, 0);
  4467.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTABLE, 0);
  4468.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_SELECTED, 0);
  4469.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_HIDDEN, 1);
  4470.                   ObjectSetInteger(0, Zong_17_st_D0 + "showtotalprofit", OBJPROP_ZORDER, 0);
  4471.                  }
  4472.                ObjectSetInteger(Lin_lo_180, Zong_17_st_D0 + "showtotalprofit", OBJPROP_BGCOLOR, Lin_ui_179);
  4473.               }
  4474.            }
  4475.         }
  4476.       Zi_4_in += Zong_19_in_EC * 4;
  4477.       Lin_ui_181 = LightCyan;
  4478.       Lin_lo_182 = 0;
  4479.       if(ObjectFind(0, Zong_17_st_D0 + "EAshowaccountprofit") <  0)
  4480.         {
  4481.          ObjectCreate(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4482.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_XDISTANCE, 298+XDis_Diff);
  4483.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4484.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_XSIZE, 280);
  4485.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_YSIZE, 60);
  4486.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_BORDER_TYPE, 0);
  4487.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_CORNER, 1);
  4488.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_COLOR, 8421376);
  4489.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_STYLE, 0);
  4490.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_WIDTH, 1);
  4491.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_BACK, 0);
  4492.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_SELECTABLE, 0);
  4493.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_SELECTED, 0);
  4494.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_HIDDEN, 1);
  4495.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_ZORDER, 0);
  4496.         }
  4497.       ObjectSetInteger(Lin_lo_182, Zong_17_st_D0 + "EAshowaccountprofit", OBJPROP_BGCOLOR, Lin_ui_181);
  4498.       Lin_ui_183 = MistyRose;
  4499.       Lin_lo_184 = 0;
  4500.       if(ObjectFind(0, Zong_17_st_D0 + "EAshowtotalprofit") <  0)
  4501.         {
  4502.          ObjectCreate(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4503.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4504.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4505.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XSIZE, 171);
  4506.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YSIZE, 60);
  4507.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4508.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_CORNER, 1);
  4509.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_COLOR, 8421376);
  4510.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_STYLE, 0);
  4511.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_WIDTH, 1);
  4512.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BACK, 0);
  4513.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTABLE, 0);
  4514.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTED, 0);
  4515.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_HIDDEN, 1);
  4516.          ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_ZORDER, 0);
  4517.         }
  4518.       ObjectSetInteger(Lin_lo_184, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BGCOLOR, Lin_ui_183);
  4519.       Zi_4_in += Zong_19_in_EC * 2;
  4520.       Zi_3_st = Zong_17_st_D0 + "EATotalProfit" + "N" ;
  4521.       Zi_10_st = Zong_17_st_D0 + "EATotalProfit" + "V" ;
  4522.       Zi_11_st = Zong_17_st_D0 + "EATotalProfit" + "P" ;
  4523.       if(Zi_6_do == 0.0 && Zi_7_do == 0.0)
  4524.         {
  4525.          Lin_in_185 = int(Zong_19_in_EC * 1.5);
  4526.          Lin_st_186 = Zong_21_st_F8;
  4527.          Lin_ui_187 = LightSkyBlue;
  4528.          Lin_st_188 = "EA opening..:";
  4529.          if(ObjectFind(Zi_3_st) == -1)
  4530.            {
  4531.             ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4532.             ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4533.             ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 188+XDis_Diff);
  4534.             ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4535.             ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4536.             ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4537.            }
  4538.          ObjectSetText(Zi_3_st, Lin_st_188, Lin_in_185, Lin_st_186, Lin_ui_187);
  4539.          Lin_in_189 = Zong_19_in_EC;
  4540.          Lin_st_190 = Zong_21_st_F8;
  4541.          Lin_ui_191 = LightSkyBlue;
  4542.          Lin_st_192 = "0.00[        DISCUZ_CODE_0        ]quot;;
  4543.          if(ObjectFind(Zi_10_st) == -1)
  4544.            {
  4545.             ObjectCreate(Zi_10_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4546.             ObjectSet(Zi_10_st, OBJPROP_CORNER, Zong_22_in_104);
  4547.             ObjectSet(Zi_10_st, OBJPROP_XDISTANCE, 35+XDis_Diff);
  4548.             ObjectSet(Zi_10_st, OBJPROP_YDISTANCE, Zi_4_in - Zong_19_in_EC);
  4549.             ObjectSet(Zi_10_st, OBJPROP_BACK, 0.0);
  4550.             ObjectSetString(0, Zi_10_st, 1001, Zong_21_st_F8);
  4551.            }
  4552.          ObjectSetText(Zi_10_st, Lin_st_192, Lin_in_189, Lin_st_190, Lin_ui_191);
  4553.          Lin_in_193 = Zong_19_in_EC;
  4554.          Lin_st_194 = Zong_21_st_F8;
  4555.          Lin_ui_195 = LightSkyBlue;
  4556.          Lin_st_196 = "0.00%";
  4557.          if(ObjectFind(Zi_11_st) == -1)
  4558.            {
  4559.             ObjectCreate(Zi_11_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4560.             ObjectSet(Zi_11_st, OBJPROP_CORNER, Zong_22_in_104);
  4561.             ObjectSet(Zi_11_st, OBJPROP_XDISTANCE, 50+XDis_Diff);
  4562.             ObjectSet(Zi_11_st, OBJPROP_YDISTANCE, Zi_4_in + Zong_19_in_EC * 2);
  4563.             ObjectSet(Zi_11_st, OBJPROP_BACK, 0.0);
  4564.             ObjectSetString(0, Zi_11_st, 1001, Zong_21_st_F8);
  4565.            }
  4566.          ObjectSetText(Zi_11_st, Lin_st_196, Lin_in_193, Lin_st_194, Lin_ui_195);
  4567.          ObjectSetText(Zi_3_st, "EA opening..:", int(Zong_19_in_EC * 1.5), Zong_21_st_F8, LightSkyBlue);
  4568.          ObjectSetText(Zi_10_st, "0.00[        DISCUZ_CODE_0        ]quot;, int(Zong_19_in_EC * 1.5), Zong_21_st_F8, LightSkyBlue);
  4569.          Lin_ui_197 = Snow;
  4570.          Lin_lo_198 = 0;
  4571.          if(ObjectFind(0, Zong_17_st_D0 + "EAshowtotalprofit") <  0)
  4572.            {
  4573.             ObjectCreate(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4574.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4575.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4576.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XSIZE, 171);
  4577.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YSIZE, 60);
  4578.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4579.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_CORNER, 1);
  4580.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_COLOR, 8421376);
  4581.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_STYLE, 0);
  4582.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_WIDTH, 1);
  4583.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BACK, 0);
  4584.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTABLE, 0);
  4585.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTED, 0);
  4586.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_HIDDEN, 1);
  4587.             ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_ZORDER, 0);
  4588.            }
  4589.          ObjectSetInteger(Lin_lo_198, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BGCOLOR, Lin_ui_197);
  4590.         }
  4591.       else
  4592.         {
  4593.          if(AccountProfit() > 0.0)
  4594.            {
  4595.             Lin_in_199 = int(Zong_19_in_EC * 1.5);
  4596.             Lin_st_200 = Zong_21_st_F8;
  4597.             Lin_ui_201 = DarkGreen;
  4598.             Lin_st_202 = "EA Profit:";
  4599.             if(ObjectFind(Zi_3_st) == -1)
  4600.               {
  4601.                ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4602.                ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4603.                ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 188+XDis_Diff);
  4604.                ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4605.                ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4606.                ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4607.               }
  4608.             ObjectSetText(Zi_3_st, Lin_st_202, Lin_in_199, Lin_st_200, Lin_ui_201);
  4609.             Lin_in_203 = Zong_19_in_EC;
  4610.             Lin_st_204 = Zong_21_st_F8;
  4611.             Lin_ui_205 = DarkGreen;
  4612.             Lin_st_206 = DoubleToString(BuyAmount + SellAmount, 2) + "[        DISCUZ_CODE_0        ]quot;;
  4613.             if(ObjectFind(Zi_10_st) == -1)
  4614.               {
  4615.                ObjectCreate(Zi_10_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4616.                ObjectSet(Zi_10_st, OBJPROP_CORNER, Zong_22_in_104);
  4617.                ObjectSet(Zi_10_st, OBJPROP_XDISTANCE, 30+XDis_Diff);
  4618.                ObjectSet(Zi_10_st, OBJPROP_YDISTANCE, Zi_4_in - Zong_19_in_EC);
  4619.                ObjectSet(Zi_10_st, OBJPROP_BACK, 0.0);
  4620.                ObjectSetString(0, Zi_10_st, 1001, Zong_21_st_F8);
  4621.               }
  4622.             ObjectSetText(Zi_10_st, Lin_st_206, Lin_in_203, Lin_st_204, Lin_ui_205);
  4623.             Lin_in_207 = Zong_19_in_EC;
  4624.             Lin_st_208 = Zong_21_st_F8;
  4625.             Lin_ui_209 = DarkGreen;
  4626.             Lin_st_210 = DoubleToString((BuyAmount + SellAmount) / Zong_23_do_108 * 100.0, 2) + "%";
  4627.             if(ObjectFind(Zi_11_st) == -1)
  4628.               {
  4629.                ObjectCreate(Zi_11_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4630.                ObjectSet(Zi_11_st, OBJPROP_CORNER, Zong_22_in_104);
  4631.                ObjectSet(Zi_11_st, OBJPROP_XDISTANCE, 50+XDis_Diff);
  4632.                ObjectSet(Zi_11_st, OBJPROP_YDISTANCE, Zi_4_in + Zong_19_in_EC * 2);
  4633.                ObjectSet(Zi_11_st, OBJPROP_BACK, 0.0);
  4634.                ObjectSetString(0, Zi_11_st, 1001, Zong_21_st_F8);
  4635.               }
  4636.             ObjectSetText(Zi_11_st, Lin_st_210, Lin_in_207, Lin_st_208, Lin_ui_209);
  4637.             ObjectSetText(Zi_3_st, "EA Profit:", int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Brown);
  4638.             ObjectSetText(Zi_10_st, DoubleToString(BuyAmount + SellAmount, 2) + "[        DISCUZ_CODE_0        ]quot;, int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Brown);
  4639.             Lin_ui_211 = Honeydew;
  4640.             Lin_lo_212 = 0;
  4641.             if(ObjectFind(0, Zong_17_st_D0 + "EAshowtotalprofit") <  0)
  4642.               {
  4643.                ObjectCreate(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4644.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4645.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4646.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XSIZE, 171);
  4647.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YSIZE, 60);
  4648.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4649.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_CORNER, 1);
  4650.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_COLOR, 8421376);
  4651.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_STYLE, 0);
  4652.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_WIDTH, 1);
  4653.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BACK, 0);
  4654.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTABLE, 0);
  4655.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTED, 0);
  4656.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_HIDDEN, 1);
  4657.                ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_ZORDER, 0);
  4658.               }
  4659.             ObjectSetInteger(Lin_lo_212, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BGCOLOR, Lin_ui_211);
  4660.            }
  4661.          else
  4662.            {
  4663.             if(AccountProfit() < 0.0)
  4664.               {
  4665.                Lin_in_213 = int(Zong_19_in_EC * 1.5);
  4666.                Lin_st_214 = Zong_21_st_F8;
  4667.                Lin_ui_215 = Brown;
  4668.                Lin_st_216 = "EA Loss:";
  4669.                if(ObjectFind(Zi_3_st) == -1)
  4670.                  {
  4671.                   ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4672.                   ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4673.                   ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 188+XDis_Diff);
  4674.                   ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4675.                   ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4676.                   ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4677.                  }
  4678.                ObjectSetText(Zi_3_st, Lin_st_216, Lin_in_213, Lin_st_214, Lin_ui_215);
  4679.                Lin_in_217 = Zong_19_in_EC;
  4680.                Lin_st_218 = Zong_21_st_F8;
  4681.                Lin_ui_219 = Brown;
  4682.                Lin_st_220 = DoubleToString(BuyAmount + SellAmount, 2) + "[        DISCUZ_CODE_0        ]quot;;
  4683.                if(ObjectFind(Zi_10_st) == -1)
  4684.                  {
  4685.                   ObjectCreate(Zi_10_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4686.                   ObjectSet(Zi_10_st, OBJPROP_CORNER, Zong_22_in_104);
  4687.                   ObjectSet(Zi_10_st, OBJPROP_XDISTANCE, 30+XDis_Diff);
  4688.                   ObjectSet(Zi_10_st, OBJPROP_YDISTANCE, Zi_4_in - Zong_19_in_EC);
  4689.                   ObjectSet(Zi_10_st, OBJPROP_BACK, 0.0);
  4690.                   ObjectSetString(0, Zi_10_st, 1001, Zong_21_st_F8);
  4691.                  }
  4692.                ObjectSetText(Zi_10_st, Lin_st_220, Lin_in_217, Lin_st_218, Lin_ui_219);
  4693.                Lin_in_221 = Zong_19_in_EC;
  4694.                Lin_st_222 = Zong_21_st_F8;
  4695.                Lin_ui_223 = Brown;
  4696.                Lin_st_224 = DoubleToString((BuyAmount + SellAmount) / Zong_23_do_108 * 100.0, 2) + "%";
  4697.                if(ObjectFind(Zi_11_st) == -1)
  4698.                  {
  4699.                   ObjectCreate(Zi_11_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4700.                   ObjectSet(Zi_11_st, OBJPROP_CORNER, Zong_22_in_104);
  4701.                   ObjectSet(Zi_11_st, OBJPROP_XDISTANCE, 50+XDis_Diff);
  4702.                   ObjectSet(Zi_11_st, OBJPROP_YDISTANCE, Zi_4_in + Zong_19_in_EC * 2);
  4703.                   ObjectSet(Zi_11_st, OBJPROP_BACK, 0.0);
  4704.                   ObjectSetString(0, Zi_11_st, 1001, Zong_21_st_F8);
  4705.                  }
  4706.                ObjectSetText(Zi_11_st, Lin_st_224, Lin_in_221, Lin_st_222, Lin_ui_223);
  4707.                ObjectSetText(Zi_3_st, "EA Loss:", int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Crimson);
  4708.                ObjectSetText(Zi_10_st, DoubleToString(BuyAmount + SellAmount, 2) + "[        DISCUZ_CODE_0        ]quot;, int(Zong_19_in_EC * 1.5), Zong_21_st_F8, Crimson);
  4709.                Lin_ui_225 = MistyRose;
  4710.                Lin_lo_226 = 0;
  4711.                if(ObjectFind(0, Zong_17_st_D0 + "EAshowtotalprofit") <  0)
  4712.                  {
  4713.                   ObjectCreate(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4714.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XDISTANCE, 190+XDis_Diff);
  4715.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YDISTANCE, Zi_4_in);
  4716.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_XSIZE, 171);
  4717.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_YSIZE, 60);
  4718.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BORDER_TYPE, 0);
  4719.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_CORNER, 1);
  4720.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_COLOR, 8421376);
  4721.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_STYLE, 0);
  4722.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_WIDTH, 1);
  4723.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BACK, 0);
  4724.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTABLE, 0);
  4725.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_SELECTED, 0);
  4726.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_HIDDEN, 1);
  4727.                   ObjectSetInteger(0, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_ZORDER, 0);
  4728.                  }
  4729.                ObjectSetInteger(Lin_lo_226, Zong_17_st_D0 + "EAshowtotalprofit", OBJPROP_BGCOLOR, Lin_ui_225);
  4730.               }
  4731.            }
  4732.         }
  4733.       Zi_4_in += Zong_19_in_EC * 4;
  4734.       Zi_4_in = int(Zi_4_in + Zong_19_in_EC * 0.5) ;
  4735.       Zi_3_st = Zong_17_st_D0 + "BuyOrders" + "N" ;
  4736.       Lin_in_227 = Zong_19_in_EC;
  4737.       Lin_st_228 = Zong_21_st_F8;
  4738.       Lin_ui_229 = CadetBlue;
  4739.       Lin_st_230 = "Buy:";
  4740.       if(ObjectFind(Zi_3_st) == -1)
  4741.         {
  4742.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4743.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4744.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 255+XDis_Diff);
  4745.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4746.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4747.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4748.         }
  4749.       ObjectSetText(Zi_3_st, Lin_st_230, Lin_in_227, Lin_st_228, Lin_ui_229);
  4750.       Zi_3_st = Zong_17_st_D0 + "BuyOrders" + "L" ;
  4751.       Lin_in_231 = Zong_19_in_EC;
  4752.       Lin_st_232 = Zong_21_st_F8;
  4753.       Lin_ui_233 = DarkBlue;
  4754.       Lin_st_234 = DoubleToString(Zi_6_do, 2) + "Lot";
  4755.       if(ObjectFind(Zi_3_st) == -1)
  4756.         {
  4757.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4758.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4759.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 120+XDis_Diff);
  4760.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4761.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4762.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4763.         }
  4764.       ObjectSetText(Zi_3_st, Lin_st_234, Lin_in_231, Lin_st_232, Lin_ui_233);
  4765.       Zi_3_st = Zong_17_st_D0 + "BuyOrders" + "P" ;
  4766.       Lin_in_235 = Zong_19_in_EC;
  4767.       Lin_st_236 = Zong_21_st_F8;
  4768.       Lin_in_237 = Zong_22_in_104;
  4769.       Lin_ui_238 = (BuyAmount >= 0.0) ? 9109504 : 3937500 ;
  4770.       Lin_st_239 = DoubleToString(BuyAmount, 2) + Zi_1_st;
  4771.       if(ObjectFind(Zi_3_st) == -1)
  4772.         {
  4773.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4774.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_237);
  4775.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 25+XDis_Diff);
  4776.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4777.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4778.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_236);
  4779.         }
  4780.       ObjectSetText(Zi_3_st, Lin_st_239, Lin_in_235, Lin_st_236, Lin_ui_238);
  4781.       Zi_2_in ++;
  4782.       Zi_4_in += Zong_19_in_EC * 2;
  4783.       Zi_3_st = Zong_17_st_D0 + "SellOrders" + "N" ;
  4784.       Lin_in_240 = Zong_19_in_EC;
  4785.       Lin_st_241 = Zong_21_st_F8;
  4786.       Lin_ui_242 = Tomato;
  4787.       Lin_st_243 = "Sell:";
  4788.       if(ObjectFind(Zi_3_st) == -1)
  4789.         {
  4790.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4791.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4792.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 255+XDis_Diff);
  4793.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4794.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4795.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4796.         }
  4797.       ObjectSetText(Zi_3_st, Lin_st_243, Lin_in_240, Lin_st_241, Lin_ui_242);
  4798.       Zi_3_st = Zong_17_st_D0 + "SellOrders" + "L" ;
  4799.       Lin_in_244 = Zong_19_in_EC;
  4800.       Lin_st_245 = Zong_21_st_F8;
  4801.       Lin_ui_246 = Tomato;
  4802.       Lin_st_247 = DoubleToString(Zi_7_do, 2) + "Lot";
  4803.       if(ObjectFind(Zi_3_st) == -1)
  4804.         {
  4805.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4806.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4807.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 120+XDis_Diff);
  4808.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4809.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4810.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4811.         }
  4812.       ObjectSetText(Zi_3_st, Lin_st_247, Lin_in_244, Lin_st_245, Lin_ui_246);
  4813.       Zi_3_st = Zong_17_st_D0 + "SellOrders" + "P" ;
  4814.       Lin_in_248 = Zong_19_in_EC;
  4815.       Lin_st_249 = Zong_21_st_F8;
  4816.       Lin_in_250 = Zong_22_in_104;
  4817.       Lin_ui_251 = (SellAmount >= 0.0) ? 9109504 : 3937500 ;
  4818.       Lin_st_252 = DoubleToString(SellAmount, 2) + Zi_1_st;
  4819.       if(ObjectFind(Zi_3_st) == -1)
  4820.         {
  4821.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4822.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_250);
  4823.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 25+XDis_Diff);
  4824.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4825.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4826.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_249);
  4827.         }
  4828.       ObjectSetText(Zi_3_st, Lin_st_252, Lin_in_248, Lin_st_249, Lin_ui_251);
  4829.       Zi_2_in ++;
  4830.       Zi_4_in += Zong_19_in_EC * 2;
  4831.       Zi_3_st = Zong_17_st_D0 + "AllOrders" + "N" ;
  4832.       Lin_in_253 = Zong_19_in_EC;
  4833.       Lin_st_254 = Zong_21_st_F8;
  4834.       Lin_ui_255 = Green;
  4835.       Lin_st_256 = "Total:";
  4836.       if(ObjectFind(Zi_3_st) == -1)
  4837.         {
  4838.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4839.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4840.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 255+XDis_Diff);
  4841.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4842.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4843.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4844.         }
  4845.       ObjectSetText(Zi_3_st, Lin_st_256, Lin_in_253, Lin_st_254, Lin_ui_255);
  4846.       Zi_3_st = Zong_17_st_D0 + "AllOrders" + "L" ;
  4847.       Lin_in_257 = Zong_19_in_EC;
  4848.       Lin_st_258 = Zong_21_st_F8;
  4849.       Lin_ui_259 = DarkBlue;
  4850.       Lin_st_260 = DoubleToString(Zi_6_do + Zi_7_do, 2) + "Lot";
  4851.       if(ObjectFind(Zi_3_st) == -1)
  4852.         {
  4853.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4854.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4855.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 120+XDis_Diff);
  4856.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4857.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4858.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4859.         }
  4860.       ObjectSetText(Zi_3_st, Lin_st_260, Lin_in_257, Lin_st_258, Lin_ui_259);
  4861.       Zi_3_st = Zong_17_st_D0 + "AllOrders" + "P" ;
  4862.       Lin_in_261 = Zong_19_in_EC;
  4863.       Lin_st_262 = Zong_21_st_F8;
  4864.       Lin_in_263 = Zong_22_in_104;
  4865.       Lin_ui_264 = (BuyAmount + SellAmount >= 0.0) ? 9109504 : 3937500 ;
  4866.       Lin_st_265 = DoubleToString(BuyAmount + SellAmount, 2) + Zi_1_st;
  4867.       if(ObjectFind(Zi_3_st) == -1)
  4868.         {
  4869.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4870.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Lin_in_263);
  4871.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 25+XDis_Diff);
  4872.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4873.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4874.          ObjectSetString(0, Zi_3_st, 1001, Lin_st_262);
  4875.         }
  4876.       ObjectSetText(Zi_3_st, Lin_st_265, Lin_in_261, Lin_st_262, Lin_ui_264);
  4877.       Zi_4_in = int(Zi_4_in + Zong_19_in_EC * 2.5) ;
  4878.       Lin_ui_266 = PowderBlue;
  4879.       Lin_lo_267 = 0;
  4880.       if(ObjectFind(0, Zong_17_st_D0 + "Separetor1") <  0)
  4881.         {
  4882.          ObjectCreate(0, Zong_17_st_D0 + "Separetor1", OBJ_RECTANGLE_LABEL, 0, 0, 0.0);
  4883.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_XDISTANCE, 298+XDis_Diff);
  4884.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_YDISTANCE, Zi_4_in);
  4885.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_XSIZE, 280);
  4886.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_YSIZE, 1);
  4887.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_BORDER_TYPE, 0);
  4888.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_CORNER, 1);
  4889.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_COLOR, 15453831);
  4890.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_STYLE, 0);
  4891.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_WIDTH, 1);
  4892.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_BACK, 0);
  4893.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_SELECTABLE, 0);
  4894.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_SELECTED, 0);
  4895.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_HIDDEN, 1);
  4896.          ObjectSetInteger(0, Zong_17_st_D0 + "Separetor1", OBJPROP_ZORDER, 0);
  4897.         }
  4898.       ObjectSetInteger(Lin_lo_267, Zong_17_st_D0 + "Separetor1", OBJPROP_BGCOLOR, Lin_ui_266);
  4899.       Zi_4_in = int(Zi_4_in + Zong_19_in_EC * 0.5);
  4900.       Zi_3_st = Zong_17_st_D0 + "copyright" + "N" ;
  4901.       Lin_in_268 = Zong_19_in_EC;
  4902.       Lin_st_269 = Zong_21_st_F8;
  4903.       Lin_ui_270 = Green;
  4904.       Lin_st_271 = MQLInfoString(MQL_PROGRAM_NAME);
  4905.       if(ObjectFind(Zi_3_st) == -1)
  4906.         {
  4907.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4908.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4909.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 125+XDis_Diff);
  4910.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4911.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4912.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4913.         }
  4914.       ObjectSetText(Zi_3_st, Lin_st_271, Lin_in_268, Lin_st_269, Lin_ui_270);
  4915.       Zi_4_in += Zong_19_in_EC * 2;
  4916.       Zi_3_st = Zong_17_st_D0 + "Expiration" + "N" ;
  4917.       Lin_in_272 = Zong_19_in_EC;
  4918.       Lin_st_273 = Zong_21_st_F8;
  4919.       Lin_ui_274 = Green;
  4920.       Lin_st_275 = " "; // "Remaining time for authorization:";
  4921.       if(ObjectFind(Zi_3_st) == -1)
  4922.         {
  4923.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4924.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4925.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 203+XDis_Diff);
  4926.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4927.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4928.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4929.         }
  4930.       ObjectSetText(Zi_3_st, Lin_st_275, Lin_in_272, Lin_st_273, Lin_ui_274);
  4931.       Zi_3_st = Zong_17_st_D0 + "Expiration" + "V" ;
  4932.       Lin_in_276 = Zong_19_in_EC;
  4933.       Lin_st_277 = Zong_21_st_F8;
  4934.       Lin_ui_278 = Green;
  4935.       Lin_st_279 = "";//string(Zong_14_in_C8) + "Day";
  4936.       if(ObjectFind(Zi_3_st) == -1)
  4937.         {
  4938.          ObjectCreate(Zi_3_st, OBJ_LABEL, 0, 0, 0.0, 0, 0.0, 0, 0.0);
  4939.          ObjectSet(Zi_3_st, OBJPROP_CORNER, Zong_22_in_104);
  4940.          ObjectSet(Zi_3_st, OBJPROP_XDISTANCE, 155+XDis_Diff);
  4941.          ObjectSet(Zi_3_st, OBJPROP_YDISTANCE, Zi_4_in);
  4942.          ObjectSet(Zi_3_st, OBJPROP_BACK, 0.0);
  4943.          ObjectSetString(0, Zi_3_st, 1001, Zong_21_st_F8);
  4944.         }
  4945.       ObjectSetText(Zi_3_st, Lin_st_279, Lin_in_276, Lin_st_277, Lin_ui_278);
  4946.       Zi_12_st = "▼" ;
  4947.       if(Zong_16_bo_CD == true)
  4948.         {
  4949.          Zi_12_st = "▲" ;
  4950.         }
  4951.       lizong_22(Zong_17_st_D0 + "OpenBoard", Zi_12_st, Zi_12_st, 80, Zi_4_in, 40, 20, Zong_22_in_104, 0, 0, Snow, Snow, Zong_21_st_F8, Zong_19_in_EC);
  4952.      }
  4953.    Zong_24_in_110 = Zi_4_in + Zong_19_in_EC + 25;
  4954.   }
  4955. //lizong_20 <<==--------   --------
  4956. void lizong_21(long Mu_0_lo, string Mu_1_st, int Mu_2_in, int Mu_3_in, int Mu_4_in, int Mu_5_in, int Mu_6_in, string Mu_7_st, string Mu_8_st, int Mu_9_in, bool Mu_10_bo)
  4957.   {
  4958.    int       Zi_1_in;
  4959.    int       Zi_2_in;
  4960. //----- -----
  4961.    Zi_1_in = (int) ChartGetInteger(Mu_0_lo, 106, 0) ;
  4962.    Zi_2_in = (Zi_1_in - Mu_5_in) / 2;
  4963.    if(Mu_3_in != 0)
  4964.      {
  4965.       Zi_2_in = Mu_3_in ;
  4966.      }
  4967.    if(ObjectFind(Mu_0_lo, Mu_1_st) <  0)
  4968.      {
  4969.       ObjectCreate(Mu_0_lo, Mu_1_st, OBJ_BITMAP_LABEL, 0, 0, 0.0);
  4970.       ObjectSetString(Mu_0_lo, Mu_1_st, 1017, 0, Mu_7_st);
  4971.       ObjectSetString(Mu_0_lo, Mu_1_st, 1017, 1, Mu_8_st);
  4972.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_XDISTANCE, Zi_2_in+XDis_Diff);
  4973.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_YDISTANCE, Mu_4_in);
  4974.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_XSIZE, Mu_5_in);
  4975.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_YSIZE, Mu_6_in);
  4976.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_XOFFSET, 0);
  4977.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_YOFFSET, 0);
  4978.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_STATE, 0);
  4979.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_ANCHOR, Mu_9_in);
  4980.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_COLOR, 255);
  4981.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_STYLE, 0);
  4982.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_WIDTH, 1);
  4983.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_BACK, Mu_10_bo);
  4984.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_SELECTABLE, 1);
  4985.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_SELECTED, 0);
  4986.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_HIDDEN, 1);
  4987.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_CORNER, Mu_9_in);
  4988.       ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_ZORDER, 0);
  4989.      }
  4990.    ObjectSetInteger(Mu_0_lo, Mu_1_st, OBJPROP_XDISTANCE, Zi_2_in);
  4991.   }
  4992. //lizong_21 <<==--------   --------
  4993. void lizong_22(string Mu_0_st, string Mu_1_st, string Mu_2_st, int Mu_3_in, int Mu_4_in, int Mu_5_in, int Mu_6_in, int Mu_7_in, uint Mu_8_ui, uint Mu_9_ui, uint Mu_10_ui, uint Mu_11_ui, string Mu_12_st, int Mu_13_in)
  4994.   {
  4995.    if(ObjectFind(0, Mu_0_st) == -1)
  4996.      {
  4997.       ObjectCreate(0, Mu_0_st, OBJ_BUTTON, 0, 0, 0.0);
  4998.      }
  4999.    ObjectSetInteger(0, Mu_0_st, OBJPROP_XDISTANCE, Mu_3_in+XDis_Diff);
  5000.    ObjectSetInteger(0, Mu_0_st, OBJPROP_YDISTANCE, Mu_4_in);
  5001.    ObjectSetInteger(0, Mu_0_st, OBJPROP_XSIZE, Mu_5_in);
  5002.    ObjectSetInteger(0, Mu_0_st, OBJPROP_YSIZE, Mu_6_in);
  5003.    ObjectSetString(0, Mu_0_st, OBJPROP_FONT, Mu_12_st);
  5004.    ObjectSetInteger(0, Mu_0_st, OBJPROP_FONTSIZE, Mu_13_in);
  5005.    ObjectSetInteger(0, Mu_0_st, OBJPROP_CORNER, Mu_7_in);
  5006.    ObjectSetInteger(0, Mu_0_st, OBJPROP_HIDDEN, 1);
  5007.    ObjectSetInteger(0, Mu_0_st, OBJPROP_BACK, 0);
  5008.    ObjectSetInteger(0, Mu_0_st, OBJPROP_SELECTABLE, 0);
  5009.    ObjectSetInteger(0, Mu_0_st, OBJPROP_SELECTED, 0);
  5010.    ObjectSetInteger(0, Mu_0_st, OBJPROP_ZORDER, 1);
  5011.    ObjectSetInteger(0, Mu_0_st, OBJPROP_BORDER_TYPE, 0);
  5012.    if(ObjectGetInteger(0, Mu_0_st, OBJPROP_STATE, 0) == 1)
  5013.      {
  5014.       ObjectSetInteger(0, Mu_0_st, OBJPROP_COLOR, Mu_8_ui);
  5015.       ObjectSetInteger(0, Mu_0_st, OBJPROP_BGCOLOR, Mu_10_ui);
  5016.       ObjectSetInteger(0, Mu_0_st, OBJPROP_BORDER_COLOR, Mu_10_ui);
  5017.       ObjectSetString(0, Mu_0_st, OBJPROP_TEXT, Mu_2_st);
  5018.       return;
  5019.      }
  5020.    ObjectSetInteger(0, Mu_0_st, OBJPROP_COLOR, Mu_9_ui);
  5021.    ObjectSetInteger(0, Mu_0_st, OBJPROP_BGCOLOR, Mu_11_ui);
  5022.    ObjectSetInteger(0, Mu_0_st, OBJPROP_BORDER_COLOR, Mu_11_ui);
  5023.    ObjectSetString(0, Mu_0_st, OBJPROP_TEXT, Mu_1_st);
  5024.   }
  5025. //<<==lizong_22 <<==
  5026. //+------------------------------------------------------------------+
  5027. //|                                                                  |
  5028. //+------------------------------------------------------------------+
  5029. bool UseCheck()
  5030.   {
  5031.    bool res = false;
  5032.    string promptMsg = "";
  5033.    string setAccount = Bind_Account;
  5034.    string setCompany = Company;
  5035.    datetime useExpiration = Use_Expiration_Time;
  5036.    if(Account_Control)
  5037.      {
  5038.       string useAccount[];
  5039.       int k = StringSplit(setAccount, useAccount, "+");
  5040.       for(int i = 0; i < k; i++)
  5041.         {
  5042.          if(AccountInfoInteger(ACCOUNT_LOGIN) == (int)useAccount)
  5043.            {
  5044.             res = true;
  5045.             break;
  5046.            }
  5047.         }
  5048.       if(!res)
  5049.          promptMsg = Account_Error_Reminder_Content;
  5050.      }
  5051.    else
  5052.      {
  5053.       res = true;
  5054.      }
  5055.    if(Time_Control && GetSystemTime() > useExpiration)
  5056.      {
  5057.       AddToPrompt(promptMsg, The_Deadline_Has_Reached_The_Reminder_Content);
  5058.       res = false;
  5059.      }
  5060.    if(Company_control && setCompany != "")
  5061.      {
  5062.       string company = AccountInfoString(ACCOUNT_COMPANY);
  5063.       if(StringFind(company, setCompany) < 0)
  5064.         {
  5065.          AddToPrompt(promptMsg, Company_Error_Reminder_Content);
  5066.          res = false;
  5067.         }
  5068.      }
  5069.    if(!res && promptMsg != "")
  5070.      {
  5071.       Alert(promptMsg);
  5072.      }
  5073.    return res;
  5074.   }
  5075. //+------------------------------------------------------------------+
  5076. //|                                                                  |
  5077. //+------------------------------------------------------------------+
  5078. void AddToPrompt(string &msg, string newMsg)
  5079.   {
  5080.    if(msg != "")
  5081.       msg += "\n" + newMsg;
  5082.    else
  5083.       msg = newMsg;
  5084.   }
  5085. //+------------------------------------------------------------------+
  5086. //|                                                                  |
  5087. //+------------------------------------------------------------------+
  5088. int StringSplit(string string_value, string &result[], string separator, string SEP = NULL)
  5089.   {
  5090.    StringTrimLeft(string_value);
  5091.    StringTrimRight(string_value);
  5092.    if(SEP != NULL)
  5093.       StringReplace(string_value, SEP, separator);
  5094.    ArrayFree(result);
  5095.    ushort u_sep = StringGetCharacter(separator, 0);
  5096.    return StringSplit(string_value, u_sep, result);
  5097.   }
  5098. datetime GetSystemTime()
  5099. {
  5100.    return (TimeCurrent());
  5101. }      
  5102. //+------------------------------------------------------------------+
  5103. bool IsNewBar()
  5104. {
  5105.    static datetime lastTime = 0;
  5106.    datetime curTime = iTime(NULL,0,0);
  5107.    if(curTime != lastTime)
  5108.    {
  5109.       lastTime = curTime;
  5110.       return true;
  5111.    }
  5112.    return false;
  5113. }
  5114. void sub_CreateButton(string obj_name,string object_text,int functionNo,int object_x_distance,int object_y_distance,color object_BGcolor,color object_OPcolor,int object_corner_value,int object_XSIZE,int object_YSIZE )//创建按钮
  5115. {
  5116.    ObjectCreate(ChartID(), obj_name,OBJ_BUTTON,0,0,0);
  5117.    ObjectSet( obj_name,OBJPROP_BGCOLOR,object_BGcolor);
  5118.    ObjectSet( obj_name,OBJPROP_CORNER,object_corner_value);
  5119.    ObjectSet( obj_name,OBJPROP_YDISTANCE,object_y_distance);
  5120.    ObjectSet( obj_name,OBJPROP_XDISTANCE,object_x_distance);
  5121.    ObjectSet( obj_name,OBJPROP_XSIZE,object_XSIZE);
  5122.    ObjectSet( obj_name,OBJPROP_YSIZE,object_YSIZE);   
  5123.    ObjectSetString(ChartID(),obj_name,OBJPROP_TEXT,object_text);
  5124.    ObjectSet( obj_name,OBJPROP_COLOR,object_OPcolor);
  5125.    // ADD THE TOOLTIP HERE
  5126.    if (functionNo==1)
  5127.    ObjectSetString(0, obj_name, OBJPROP_TOOLTIP, "Close All");
  5128.    else if (functionNo==2)
  5129.    ObjectSetString(0, obj_name, OBJPROP_TOOLTIP, "Test Telegram");
  5130.    else
  5131.    ObjectSetString(0, obj_name, OBJPROP_TOOLTIP, "Force to Trade Status");
  5132. }
复制代码

Panel

Panel

Back test

Back test
举报

评论 使用道具

精彩评论6

caiyong770
D
| 发表于 2026-8-14 23:04:55 | 显示全部楼层
能说下它的核心是什么?
举报

点赞 评论 使用道具

940567491
DD
| 发表于 2026-8-14 23:39:16 | 显示全部楼层
龟龟,好家伙这么发帖啊
举报

点赞 评论 使用道具

qip7205
DD
| 发表于 2026-8-15 21:18:40 | 显示全部楼层
厉害呀,拉的我累。
举报

点赞 评论 使用道具

lzysmovie
D
| 发表于 2026-8-16 01:17:41 | 显示全部楼层
下了,感谢大佬
我改中文版的了
举报

点赞 评论 使用道具

牛策智创
DD
| 发表于 2026-8-31 22:41:52 | 显示全部楼层
这个思路很清晰
举报

点赞 评论 使用道具

顶级EA
DD
| 发表于 2026-9-2 11:44:16 | 显示全部楼层
好人一生平安
举报

点赞 评论 使用道具

发新帖
EA交易
您需要登录后才可以评论 登录 | 立即注册