Ejemplo n.º 1
0
        public void OQOrderTypeToIBOrderType_Limit_Test()
        {
            StingrayOQ_Accessor target = new StingrayOQ_Accessor();

            OQ.OrderType oqtype = OQ.OrderType.Limit;
            IB.OrderType ibtype;
            bool         result = Helpers.OQOrderTypeToIBOrderType(oqtype, out ibtype);

            Assert.IsTrue(result, "returns true");
            Assert.AreEqual(IB.OrderType.Limit, ibtype, "IB Order Type");
        }
Ejemplo n.º 2
0
        public static bool OrderTypeToOrderType(IB.OrderType ibordertype, out OQ.OrderType oqordertype)
        {
            oqordertype = OQ.OrderType.Market;
            switch (ibordertype)
            {
            case IB.OrderType.Limit:
            case IB.OrderType.LimitOnClose:
                oqordertype = OQ.OrderType.Limit;
                break;

            case IB.OrderType.Market:
                oqordertype = OQ.OrderType.Market;
                break;

            case IB.OrderType.MarketOnClose:
                oqordertype = OQ.OrderType.MarketOnClose;
                break;

            case IB.OrderType.Stop:
                oqordertype = OQ.OrderType.Stop;
                break;

            case IB.OrderType.StopLimit:
                oqordertype = OQ.OrderType.StopLimit;
                break;

            case IB.OrderType.TrailingStop:
                oqordertype = OQ.OrderType.Trail;
                break;

            case IB.OrderType.TrailingStopLimit:
                oqordertype = OQ.OrderType.TrailLimit;
                break;

            default:
            case IB.OrderType.Volatility:
            case IB.OrderType.VolumeWeightedAveragePrice:
            case IB.OrderType.Scale:
            case IB.OrderType.Relative:
            case IB.OrderType.PeggedToMarket:
            case IB.OrderType.Default:
            case IB.OrderType.Empty:
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
        public static bool OQOrderTypeToIBOrderType(OQ.OrderType oqtype, out IB.OrderType ibtype)
        {
            ibtype = IB.OrderType.Empty;
            switch (oqtype)
            {
            case OQ.OrderType.Limit:
                ibtype = IB.OrderType.Limit;
                break;

            case OQ.OrderType.Market:
                ibtype = IB.OrderType.Market;
                break;

            case OQ.OrderType.MarketOnClose:
                ibtype = IB.OrderType.MarketOnClose;
                break;

            case OQ.OrderType.Stop:
                ibtype = IB.OrderType.Stop;
                break;

            case OQ.OrderType.StopLimit:
                ibtype = IB.OrderType.StopLimit;
                break;

            case OQ.OrderType.Trail:
                ibtype = IB.OrderType.TrailingStop;
                break;

            case OQ.OrderType.TrailLimit:
                ibtype = IB.OrderType.TrailingStopLimit;
                break;

            default:
                return(false);
            }
            return(true);
        }