评论

收藏

加码手数写法

avatar xuezhe | 910 人阅读 | 0 人评论 | 2018-07-08

  1. double 报仇手数() {
  2.    double profit;
  3.    int count_24;
  4.    double PFmin;
  5.    int 低谷;
  6.    double PFmax;
  7.    int 巅峰;
  8.    double PFmaxPre;
  9.    int 前高;
  10.    double ld_8 = 1;
  11.    if (马丁 > 0.0 && AutoMM > 0.0) {
  12.       profit = 0;
  13.       count_24 = 0;
  14.       PFmin = 0;
  15.       低谷 = 0;
  16.       PFmax = 0;
  17.       巅峰 = 0;
  18.       for (int pos_64 = OrdersHistoryTotal() - 1; pos_64 >= 0; pos_64--) {
  19.          if (OrderSelect(pos_64, SELECT_BY_POS, MODE_HISTORY)) {
  20.             if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic) {
  21.                count_24++;
  22.                profit += OrderProfit();
  23.                if (profit > PFmax) {
  24.                   PFmax = profit;
  25.                   巅峰 = count_24;
  26.                }
  27.                if (profit < PFmin) {
  28.                   PFmin = profit;
  29.                   低谷 = count_24;
  30.                }
  31.                if (count_24 >= 恢复检查柱数) break;//100
  32.             }
  33.          }
  34.       }
  35.       if (巅峰 <= 低谷) ld_8 = MathPow(马丁, 低谷);//........低谷........巅峰.........
  36.       else //.......巅峰.........低谷.........
  37.       {
  38.          profit = PFmax;
  39.          count_24 = 巅峰;
  40.          PFmaxPre = PFmax;
  41.          前高 = 巅峰;
  42.          //....前高......巅峰.........低谷.........
  43.          for (pos_64 = OrdersHistoryTotal() - 巅峰 - 1; pos_64 >= 0; pos_64--)
  44.          {
  45.             if (OrderSelect(pos_64, SELECT_BY_POS, MODE_HISTORY)) {
  46.                if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic) {
  47.                   if (count_24 >= 恢复检查柱数) break;
  48.                   count_24++;
  49.                   profit += OrderProfit();
  50.                   if (profit < PFmaxPre) {
  51.                      PFmaxPre = profit;
  52.                      前高 = count_24;
  53.                   }
  54.                }
  55.             }
  56.          }
  57.          if (前高 == 巅峰 || PFmaxPre == PFmax) ld_8 = MathPow(马丁, 低谷);
  58.          else
  59.          {                                                             //10
  60.             if (MathAbs(PFmin - PFmax) / MathAbs(PFmaxPre - PFmax) >= (gd_324 + 100.0) / 100.0) ld_8 = MathPow(马丁, 低谷);
  61.             else ld_8 = MathPow(马丁, 前高);
  62.          }
  63.       }
  64.    }
  65.    for (double ld_ret_0 = MathMax(g_minlot_384, MathMin(g_maxlot_392, MathCeil(MathMin(AutoMM_Max, ld_8 * AutoMM) / 100.0 * AccountFreeMargin() / g_lotstep_400 / (g_lotsize_408 / 100)) * g_lotstep_400)); ld_ret_0 >= 2.0 * g_minlot_384 &&
  66.       1.05 * (ld_ret_0 * g_marginrequired_412) >= AccountFreeMargin(); ld_ret_0 -= g_minlot_384) {
  67.    }
  68.    return (ld_ret_0);
  69. }
复制代码


""
还没有人打赏,支持一下
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则