EA 小代码

来源:百度文库 编辑:神马文学网 时间:2024/04/29 12:03:48
开仓后,第25分钟的时间是OrderOpenTime( ) +25*60
所以比较就用 if (TimeCurrent() > (OrderOpenTime( ) +25*60))判断时间是否到达

时间转数组下标用int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)      for(i=0;i   if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
   {
      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL) { sell_profit+=OrderProfit(); sell_points+=Ask-OrderOpenPrice();}
      if(OrderSymbol()==Symbol() && OrderType()==OP_BUY) { buy_profit+=OrderProfit(); buy_points+=Bid-OrderOpenPrice();}