예제 #1
0
        public static bool FAAllocationMethodTOIBFAMethod(IB.FinancialAdvisorAllocationMethod ibFaMethod,
                                                          out OQ.IBFaMethod oqFaMethod)
        {
            oqFaMethod = IBFaMethod.Undefined;
            switch (ibFaMethod)
            {
            case FinancialAdvisorAllocationMethod.AvailableEquity:
                oqFaMethod = IBFaMethod.AvailableEquity;
                break;

            case FinancialAdvisorAllocationMethod.EqualQuantity:
                oqFaMethod = IBFaMethod.EqualQuantity;
                break;

            case FinancialAdvisorAllocationMethod.NetLiquidity:
                oqFaMethod = IBFaMethod.NetLiq;
                break;

            case FinancialAdvisorAllocationMethod.PercentChange:
                oqFaMethod = IBFaMethod.PctChange;
                break;

            case FinancialAdvisorAllocationMethod.None:
            default:
                return(false);
            }
            return(true);
        }
예제 #2
0
        public static bool OQFAMethodTOIBFAMethod(OQ.IBFaMethod oqFaMethod,
                                                  out IB.FinancialAdvisorAllocationMethod ibFaMethod)
        {
            ibFaMethod = FinancialAdvisorAllocationMethod.None;
            switch (oqFaMethod)
            {
            case IBFaMethod.AvailableEquity:
                ibFaMethod = FinancialAdvisorAllocationMethod.AvailableEquity;
                break;

            case IBFaMethod.EqualQuantity:
                ibFaMethod = FinancialAdvisorAllocationMethod.EqualQuantity;
                break;

            case IBFaMethod.NetLiq:
                ibFaMethod = FinancialAdvisorAllocationMethod.NetLiquidity;
                break;

            case IBFaMethod.PctChange:
                ibFaMethod = FinancialAdvisorAllocationMethod.PercentChange;
                break;

            case IBFaMethod.Undefined:
                ibFaMethod = FinancialAdvisorAllocationMethod.None;
                break;

            default:
                return(false);
            }
            return(true);
        }
예제 #3
0
        public void OQFAMethodTOIBFAMethod_NetLiq_Test()
        {
            StingrayOQ_Accessor target = new StingrayOQ_Accessor();

            OQ.IBFaMethod oqFaMethod = IBFaMethod.NetLiq;
            FinancialAdvisorAllocationMethod ibFaMethod;
            bool result = Helpers.OQFAMethodTOIBFAMethod(oqFaMethod, out ibFaMethod);

            Assert.IsTrue(result);
            Assert.AreEqual(IB.FinancialAdvisorAllocationMethod.NetLiquidity, ibFaMethod);
        }