public ProcessState_Default(ProcessController_KtbSkel parent)
        {
            _parent = parent;

            _spotCode = _parent.Parent.SpotCode;
            _futureCode = _parent.Parent.FutureCode;
            _maxNotional = _parent.Parent.MaxNotional;
            _monitorExit = _parent.MonitorExit;

            _stack = _parent.SortedPositionStack;
        }
 public SortedPositionStack_KtbSkel(
     ProcessController_KtbSkel parent,
     String strategyName, String spotCode, String futureCode, 
     long maxNotional, double downBoundary, double upBoundary)
 {
     _parent = parent;
     this.StrategyName = strategyName;
     this.SpotCode = spotCode;
     this.FutureCode = futureCode;
     this.MaxNotional = maxNotional;
     this.DownBoundary = downBoundary;
     this.UpBoundary = upBoundary;
 }
        public ProcessState_EnterExit(
            double indicator,
            ProcessController_KtbSkel parent,
            long unsignedNotional, 
            RawMarketData spotRmd, 
            RawMarketData futureRmd,
            IInOutPolicy enterExitPolicy, 
            Boolean showUI)
        {
            _parent = parent;
            _unsignedNotional = unsignedNotional;
            _enterExitPolicy = enterExitPolicy;
            _futureAccount = _parent.FutureAccount;

            SetTargetPosition(spotRmd, futureRmd);

            _sweepController = new ManualSweepController_KtbSkel(_targetPosition);

            if (showUI)
            {
                CreateUI(indicator);
            }
        }
 void TestKtbSkelProcessConstructor_Raw(ProcessController_KtbSkel controller)
 {
     TestKtbSkelProcess_Default_Constructor_Raw(controller);
     TestKtbSkelProcess_Entering_Constructor_Raw(controller);
     TestKtbSkelProcess_Exiting_Constructor_Raw(controller);
 }
        void TestKtbSkelProcess_Exiting_Constructor_Raw(ProcessController_KtbSkel controller)
        {
            RawMarketData spotRmd = RmdManager.Ins().KtbSpot.GetData(controller.Parent.SpotCode);
            RawMarketData futureRmd = RmdManager.Ins().Future.GetData(controller.Parent.FutureCode);

            spotRmd = spotRmd.Clone() as RawMarketData;
            futureRmd = futureRmd.Clone() as RawMarketData;

            spotRmd.BidPrice1 = 8888F;
            spotRmd.AskPrice1 = 8889F;

            futureRmd.BidPrice1 = 107.01F;
            futureRmd.AskPrice1 = 107.02F;

            IInOutPolicy exitPolicy = new OutPolicy();
            ProcessState_EnterExit process = new ProcessState_EnterExit(
                1.0F,
                controller,
                10,
                spotRmd,
                futureRmd,
                exitPolicy,
                false);

            ProcessState_EnterExit_Accessor acc = new ProcessState_EnterExit_Accessor(new PrivateObject(process));
            Assert.AreEqual(acc._enterExitPolicy.GetInOutType(), InOutType.OutType);
        }
        void TestKtbSkelProcess_Default_Constructor_Raw(ProcessController_KtbSkel controller)
        {
            ProcessState_Default process = new ProcessState_Default(controller);
            ProcessState_Default_Accessor acc = new ProcessState_Default_Accessor(
                new PrivateObject(process));

            Assert.AreEqual(acc._parent, controller);
            Assert.AreEqual(acc._futureCode, controller.Parent.FutureCode);
            Assert.AreEqual(acc._spotCode, controller.Parent.SpotCode);
            Assert.AreEqual(acc._maxNotional, controller.MaxNotional);
            Assert.AreEqual(acc._stack, controller.SortedPositionStack);
            Assert.AreEqual(acc._monitorExit, controller.MonitorExit);
        }
Esempio n. 7
0
 public void ExecuteAfterSweeperDone(ProcessController_KtbSkel controller, Position_KtbSkel position)
 {
     // Out, 
     controller.SortedPositionStack.Erase(position);
 }
Esempio n. 8
0
 public MonitorExit_KtbSkel(ProcessController_KtbSkel parent)
 {
     _parent = parent;
     _spotCode = parent.Parent.SpotCode;
     _futureCode = parent.Parent.FutureCode;
 }