I am developing a strategy and for submitting TP and SL in UnManaged Mode using the following code but get "Buy stop or buy stop limit orders can't be placed below the market"
// For Buy order SubmitOrderUnmanaged(0, OrderAction.Sell, OrderType.StopMarket, execution.Order.Filled, 0, execution.Order.AverageFillPrice - 90* TickSize, strOCOID, "BuyStop"); SubmitOrderUnmanaged(0, OrderAction.Sell, OrderType.Limit, execution.Order.Filled, execution.Order.AverageFillPrice + 40* TickSize, 0, strOCOID, "BuyTarget"); //For Sell order SubmitOrderUnmanaged(0, OrderAction.BuyToCover, OrderType.StopMarket, execution.Order.Filled, 0, execution.Order.AverageFillPrice + 40* TickSize, strOCOID, "SellStop"); SubmitOrderUnmanaged(0, OrderAction.BuyToCover, OrderType.Limit, execution.Order.Filled, execution.Order.AverageFillPrice - 90* TickSize, 0, strOCOID, "SellTarget");
Comment