历史回测,怎么是同时买入/平仓呢
//买入条件 entry_condition1 = MidLine[1] < MidLine[0]; entry_condition2 = CrossOver(kValue[0], DValue[0]); if( MarketPosition<>1 and entry_condition1 and entry_condition2) { buy(lots,Open); takeprofeprice = open+win*minmove*pricescale; stoplostprice = open-loss*minmove*pricescale; } PlotNumeric ("takeprofeprice ",takeprofeprice,0,Red); PlotNumeric ("stoplostprice ",stoplostprice,0,Green); //出场 how_S =T*60; for i=0 to how_S { if( MarketPosition == 1 and High>=takeprofeprice) { Sell(0,max(Open,takeprofeprice)); } if( MarketPosition == 1 and Low<=stoplostprice) { Sell(0,Min(Open,stoplostprice)); } } 历史回测,怎么是同时买入/平仓呢 实盘中,平仓作废 程序顺序,是先入场,后出场啊 该怎么改进呢?