示例#1
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public Order()
 {
     openClose             = "O";
     origin                = OrderOrigin.Customer;
     transmit              = true;
     tif                   = TimeInForce.Day;
     designatedLocation    = "";
     minQty                = Int32.MaxValue;
     percentOffset         = Double.MaxValue;
     nbboPriceCap          = decimal.MaxValue;
     startingPrice         = decimal.MaxValue;
     stockRefPrice         = Double.MaxValue;
     delta                 = Double.MaxValue;
     stockRangeLower       = Double.MaxValue;
     stockRangeUpper       = Double.MaxValue;
     volatility            = Double.MaxValue;
     volatilityType        = VolatilityType.Undefined;
     deltaNeutralOrderType = OrderType.Empty;
     deltaNeutralAuxPrice  = Double.MaxValue;
     referencePriceType    = Int32.MaxValue;
     trailStopPrice        = decimal.MaxValue;
     basisPoints           = decimal.MaxValue;
     basisPointsType       = Int32.MaxValue;
     scaleInitLevelSize    = Int32.MaxValue;
     scaleSubsLevelSize    = Int32.MaxValue;
     scalePriceIncrement   = decimal.MaxValue;
     faMethod              = FinancialAdvisorAllocationMethod.None;
     notHeld               = false;
 }
示例#2
0
        public void FAAllocationMethodTOIBFAMethodTest()
        {
            FinancialAdvisorAllocationMethod ibFaMethod = FinancialAdvisorAllocationMethod.NetLiquidity;
            IBFaMethod oqFaMethod;
            bool       result = Helpers.FAAllocationMethodTOIBFAMethod(ibFaMethod, out oqFaMethod);

            Assert.IsTrue(result);
            Assert.AreEqual(IBFaMethod.NetLiq, oqFaMethod);
        }
示例#3
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public Order()
 {
     openClose = "O";
     origin = OrderOrigin.Customer;
     transmit = true;
     tif = TimeInForce.Day;
     designatedLocation = "";
     minQty = Int32.MaxValue;
     percentOffset = Double.MaxValue;
     nbboPriceCap = decimal.MaxValue;
     startingPrice = decimal.MaxValue;
     stockRefPrice = Double.MaxValue;
     delta = Double.MaxValue;
     stockRangeLower = Double.MaxValue;
     stockRangeUpper = Double.MaxValue;
     volatility = Double.MaxValue;
     volatilityType = VolatilityType.Undefined;
     deltaNeutralOrderType = OrderType.Empty;
     deltaNeutralAuxPrice = Double.MaxValue;
     referencePriceType = Int32.MaxValue;
     trailStopPrice = decimal.MaxValue;
     basisPoints = decimal.MaxValue;
     basisPointsType = Int32.MaxValue;
     scaleInitLevelSize = Int32.MaxValue;
     scaleSubsLevelSize = Int32.MaxValue;
     scalePriceIncrement = decimal.MaxValue;
     faMethod = FinancialAdvisorAllocationMethod.None;
     notHeld = false;
     exemptCode = -1;
     
     optOutSmartRouting = false;
     deltaNeutralConId = 0;
     deltaNeutralOrderType = OrderType.Empty;
     deltaNeutralSettlingFirm = string.Empty;
     deltaNeutralClearingAccount = string.Empty;
     deltaNeutralClearingIntent = string.Empty;
 }
示例#4
0
文件: Order.cs 项目: qusma/ib-csharp
        /// <summary>
        /// Default Constructor
        /// </summary>
        public Order()
        {
            openClose = "O";
            origin = OrderOrigin.Customer;
            transmit = true;
            tif = TimeInForce.Day;
            designatedLocation = "";
            minQty = int.MaxValue;
            percentOffset = double.MaxValue;
            nbboPriceCap = decimal.MaxValue;
            startingPrice = decimal.MaxValue;
            stockRefPrice = double.MaxValue;
            delta = double.MaxValue;
            stockRangeLower = double.MaxValue;
            stockRangeUpper = double.MaxValue;
            volatility = double.MaxValue;
            volatilityType = VolatilityType.Undefined;
            deltaNeutralOrderType = OrderType.Empty;
            deltaNeutralAuxPrice = double.MaxValue;
            referencePriceType = int.MaxValue;
            trailStopPrice = decimal.MaxValue;
            basisPoints = decimal.MaxValue;
            basisPointsType = int.MaxValue;
            scaleInitLevelSize = int.MaxValue;
            scaleSubsLevelSize = int.MaxValue;
            scalePriceIncrement = decimal.MaxValue;
            faMethod = FinancialAdvisorAllocationMethod.None;
            notHeld = false;
            exemptCode = -1;

            optOutSmartRouting = false;
            deltaNeutralConId = 0;
            deltaNeutralOrderType = OrderType.Empty;
            deltaNeutralSettlingFirm = string.Empty;
            deltaNeutralClearingAccount = string.Empty;
            deltaNeutralClearingIntent = string.Empty;

            DeltaNeutralOpenClose = "";
            DeltaNeutralShortSale = false;
            DeltaNeutralShortSaleSlot = 0;
            DeltaNeutralDesignatedLocation = "";
            referencePriceType = int.MaxValue;
            trailStopPrice = decimal.MaxValue;
            TrailingPercent = double.MaxValue;
            BasisPoints = decimal.MaxValue;
            basisPointsType = int.MaxValue;
            scaleInitLevelSize = int.MaxValue;
            scaleSubsLevelSize = int.MaxValue;
            scalePriceIncrement = decimal.MaxValue;
            ScalePriceAdjustValue = double.MaxValue;
            ScalePriceAdjustInterval = int.MaxValue;
            ScaleProfitOffset = double.MaxValue;
            ScaleAutoReset = false;
            ScaleInitPosition = int.MaxValue;
            ScaleInitFillQty = int.MaxValue;
            ScaleRandomPercent = false;
            ScaleTable = "";
            whatIf = false;
            notHeld = false;
            Conditions = new List<OrderCondition>();
            TriggerPrice = double.MaxValue;
            LmtPriceOffset = double.MaxValue;
            AdjustedStopPrice = double.MaxValue;
            AdjustedStopLimitPrice = double.MaxValue;
            AdjustedTrailingAmount = double.MaxValue;
            ExtOperator = "";
        }
示例#5
0
        public bool Initialize(SerializableDictionary<string, string> settings)
        {
            string rth = "";
            string ignorelast;

            string clientIDBroker = "";
            string clientIDLiveData = "";
            string clientIDHist = "";

            if (settings.TryGetValue("UseRTH", out rth))
            {
                _useRTH = Convert.ToBoolean(rth);
            }

            if (settings.TryGetValue("IgnoreLastHistBar", out ignorelast))
            {
                dropLastHistBar = Convert.ToBoolean(ignorelast);
            }

            if (settings.TryGetValue("ClientIDBroker", out clientIDBroker))
            {
                int.TryParse(clientIDBroker, out _clientIDBroker);
            }

            if (settings.TryGetValue("ClientIDLiveData", out clientIDLiveData))
            {
                int.TryParse(clientIDLiveData, out _clientIDLiveData);
            }

            if (settings.TryGetValue("ClientIDHist", out clientIDHist))
            {
                int.TryParse(clientIDHist, out _clientIDHist);
            }

            settings.TryGetValue("AccountCode", out accountCode);

            string faMethod;
            if (settings.TryGetValue("FAMethod", out faMethod))
            {
                _FAMethod = GetFAMethod(faMethod);
            }

            settings.TryGetValue("FAPercentage", out _FAPercentage);

            settings.TryGetValue("FAProfile", out _FAProfile);

            return true;
        }
示例#6
0
        /// <summary>
        /// Default Constructor
        /// </summary>
        public Order()
        {
            openClose             = "O";
            origin                = OrderOrigin.Customer;
            transmit              = true;
            tif                   = TimeInForce.Day;
            designatedLocation    = "";
            minQty                = int.MaxValue;
            percentOffset         = double.MaxValue;
            nbboPriceCap          = decimal.MaxValue;
            startingPrice         = decimal.MaxValue;
            stockRefPrice         = double.MaxValue;
            delta                 = double.MaxValue;
            stockRangeLower       = double.MaxValue;
            stockRangeUpper       = double.MaxValue;
            volatility            = double.MaxValue;
            volatilityType        = VolatilityType.Undefined;
            deltaNeutralOrderType = OrderType.Empty;
            deltaNeutralAuxPrice  = double.MaxValue;
            referencePriceType    = int.MaxValue;
            trailStopPrice        = decimal.MaxValue;
            basisPoints           = decimal.MaxValue;
            basisPointsType       = int.MaxValue;
            scaleInitLevelSize    = int.MaxValue;
            scaleSubsLevelSize    = int.MaxValue;
            scalePriceIncrement   = decimal.MaxValue;
            faMethod              = FinancialAdvisorAllocationMethod.None;
            notHeld               = false;
            exemptCode            = -1;

            optOutSmartRouting          = false;
            deltaNeutralConId           = 0;
            deltaNeutralOrderType       = OrderType.Empty;
            deltaNeutralSettlingFirm    = string.Empty;
            deltaNeutralClearingAccount = string.Empty;
            deltaNeutralClearingIntent  = string.Empty;

            DeltaNeutralOpenClose          = "";
            DeltaNeutralShortSale          = false;
            DeltaNeutralShortSaleSlot      = 0;
            DeltaNeutralDesignatedLocation = "";
            referencePriceType             = int.MaxValue;
            trailStopPrice           = decimal.MaxValue;
            TrailingPercent          = double.MaxValue;
            BasisPoints              = decimal.MaxValue;
            basisPointsType          = int.MaxValue;
            scaleInitLevelSize       = int.MaxValue;
            scaleSubsLevelSize       = int.MaxValue;
            scalePriceIncrement      = decimal.MaxValue;
            ScalePriceAdjustValue    = double.MaxValue;
            ScalePriceAdjustInterval = int.MaxValue;
            ScaleProfitOffset        = double.MaxValue;
            ScaleAutoReset           = false;
            ScaleInitPosition        = int.MaxValue;
            ScaleInitFillQty         = int.MaxValue;
            ScaleRandomPercent       = false;
            ScaleTable             = "";
            whatIf                 = false;
            notHeld                = false;
            Conditions             = new List <OrderCondition>();
            TriggerPrice           = double.MaxValue;
            LmtPriceOffset         = double.MaxValue;
            AdjustedStopPrice      = double.MaxValue;
            AdjustedStopLimitPrice = double.MaxValue;
            AdjustedTrailingAmount = double.MaxValue;
            ExtOperator            = "";
        }