public override CheDanArgs PolicyCheDan(KeCheDetail kcd) { CheDanArgs cda = new CheDanArgs(); cda.Tsopt = TradeSendOrderPriceType.Limit; cda.ZhuiDan = false; if (NeedCheDanWeiTuos.ContainsKey(kcd.ClientBianHao)) { cda.Cancel = true; } return(cda); }
public override CheDanArgs PolicyCheDan(KeCheDetail kcd) { CheDanArgs cda = new CheDanArgs(); cda.Tsopt = TradeSendOrderPriceType.Limit; TickData tick = CurrentStockData.GetTick(kcd.Si); if (kcd.UnDealQty >= kcd.Si.MinQty) { if (kcd.OverTime()) { if (kcd.OpenType == OpenType.Buy) { decimal newPrice = (decimal)(Math.Floor(tick.Ask / SecInfo.PriceJingDu) * SecInfo.PriceJingDu) + (decimal)parameter.HuaDian; if ((decimal)kcd.OrderPrice < newPrice) { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = (double)newPrice; } } else if (kcd.OpenType == OpenType.Sell) { decimal newPrice = (decimal)(Math.Floor(tick.Bid / SecInfo.PriceJingDu) * SecInfo.PriceJingDu) - (decimal)parameter.HuaDian; if ((decimal)kcd.OrderPrice > newPrice) { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = (double)newPrice; } } } } else { if (kcd.Si.Key == SecInfo.Key) { firstDeal = true; } if (kcd.Si.Key == SecondSi.Key) { secondDeal = true; } } return(cda); }
public virtual CheDanArgs PolicyCheDan(KeCheDetail kcd) { CheDanArgs cda = new CheDanArgs(); TickData tick = CurrentStockData.GetTick(kcd.Si); if (kcd.OverTime()) { if (kcd.TradeType == PolicyTradeType.Open) //入场单 { cda.Cancel = true; cda.ZhuiDan = false; } else//出场单 { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = tick.Last; } } return(cda); }
public override CheDanArgs PolicyCheDan(KeCheDetail kcd) { CheDanArgs cda = new CheDanArgs(); TickData tick = CurrentStockData.GetTick(kcd.Si); if (kcd.OverTime()) { if (kcd.OpenType == OpenType.Buy) { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = tick.Ask; } else { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = tick.Bid; } } return(cda); }
public override CheDanArgs PolicyCheDan(KeCheDetail kcd) { CheDanArgs cda = new CheDanArgs(); cda.Tsopt = TradeSendOrderPriceType.Limit; TickData tick = CurrentStockData.GetTick(kcd.Si); if (kcd.OverTime()) { if ((kcd.OpenType == OpenType.KaiDuo || kcd.OpenType == OpenType.PingKong) && kcd.OrderPrice != tick.Ask) { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = tick.Ask; } else if ((kcd.OpenType == OpenType.KaiKong || kcd.OpenType == OpenType.PingDuo) && kcd.OrderPrice != tick.Bid) { cda.Cancel = true; cda.ZhuiDan = true; cda.NewOrderPrice = tick.Bid; } } return(cda); }