static datetime OpenBarTime=-1; if(开盘条件 && BarTime != time[0] ) { 开仓操作; OpenBarTime = time[0]; //开仓成功后,记录当前K线的时间 }