コード例 #1
0
        public IMonitor_Door Run(Monitor_UnderlyingPrice.Signal signal)
        {
            if (signal == Monitor_UnderlyingPrice.Signal.Rebalance)
            {
                // Canceling 상태로 재빨리 옮겨야 한다.
                Monitor_Door_Canceling next = new Monitor_Door_Canceling(_parent, _orders);
                return next;
            }

            // 위험해 보이는 주문은 취소하고 너무 많이 취소 했다면 다시 진행하도록 한다.
            int canceledCountThisTurn = CancelDangerousOrders();
            _canceledOrderCount += canceledCountThisTurn;
            int cancedOrderPercent = 100 * _canceledOrderCount / (1 + _orders.Count);
            if (cancedOrderPercent >= 10)
            {
                Monitor_Door_Canceling next = new Monitor_Door_Canceling(_parent, _orders);
                return next;
            }

            int emptyChannel = GetEmptyChannelCount();

            for (int i = 0; i < emptyChannel; ++i)
            {
                EnterNewDoorOrder();
            }
            return this;
        }
コード例 #2
0
 public IMonitor_Door Run(Monitor_UnderlyingPrice.Signal signal)
 {
     if (_parent.EnterAfterCancel)
     {
         // rebalancing signal이 오고 AutoEnter 상태라면 Entering state로 변경
         Monitor_Door_Entering next = new Monitor_Door_Entering(_parent);
         return next;
     }
     return this;
 }
コード例 #3
0
        public MonitorController_Door(STR_Door parent)
        {
            Parent = parent;

            double targetStrikeOffset = Parent.Input.DoorStrikeOffset;
            double moveBuffer = Parent.Input.MoveBuffer;

            MonitorPrice = new Monitor_UnderlyingPrice(targetStrikeOffset, moveBuffer);
            _monitorDoor = new Monitor_Door_Ready(this);

            _futureCode = KospiFutureUtil.Ins().KFI.Code;

            _monitorTime = DateUtil.GetTodayDateTime(12 + 2 + Const.kHourAdjustment_End, 59, 59);

            this.EnterAfterCancel = false;
            this.EnterMinCount = true;
        }
コード例 #4
0
        public IMonitor_Door Run(Monitor_UnderlyingPrice.Signal signal)
        {
            // 모든 주문이 Cancel되면 Ready상태로 간다.
            if (IsAllDone())
            {
                Monitor_Door_Ready next = new Monitor_Door_Ready(_parent);
                return next;
            }

            int emptyCount = GetEmptyChannelCount();

            for (int i = 0; i < emptyCount; ++i)
            {
                CancelOrder();
            }

            return this;
        }