限制今天或某一天的写法

楼主  收藏   举报   帖子创建时间:  2019-05-05 12:06 回复:0 关注量:176
  1. double GetProfitForDay(int ai_0)

  2. {

  3.    double ld_ret_4 = 0;

  4.    for (int l_pos_12 = 0; l_pos_12 < OrdersHistoryTotal(); l_pos_12++) {

  5.       if (!(OrderSelect(l_pos_12, SELECT_BY_POS, MODE_HISTORY))) break;

  6.       if (OrderSymbol() == Symbol() && (OrderMagicNumber() == BuyMagic || OrderMagicNumber() == SellMagic))

  7.          if (OrderCloseTime() >= iTime(Symbol(), PERIOD_D1, ai_0) && OrderCloseTime() < iTime(Symbol(), PERIOD_D1, ai_0) + 86400) ld_ret_4 += OrderProfit();

  8.    }

  9.    return (ld_ret_4);

  10. }
打赏