示例#1
0
        private void clickStatusButton(object sender, EventArgs e)
        {
            BackEnd.clock.Stop();
            if (Riders.AtID(selectionID).layorders == null)
            {
                return;
            }

            List <CancelInstruction> cancelInstructions = new List <CancelInstruction>();
            CancelInstruction        cancelInstruction;

            for (int i = 0; i < Riders.AtID(selectionID).layorders.Count; i++)
            {
                cancelInstruction       = new CancelInstruction();
                cancelInstruction.BetId = Riders.AtID(selectionID).layorders[i].BetId;
                cancelInstructions.Add(cancelInstruction);
            }

            for (int i = 0; i < Riders.AtID(selectionID).backorders.Count; i++)
            {
                cancelInstruction       = new CancelInstruction();
                cancelInstruction.BetId = Riders.AtID(selectionID).backorders[i].BetId;
                cancelInstructions.Add(cancelInstruction);
            }

            ApiSet.CancelOrders(cancelInstructions);
            BackEnd.clock.Start();
        }
示例#2
0
        private void clickEnter(object sender, EventArgs e)
        {
            Riders.AtID(ID).hasAutoOrder = true;
            Riders.AtID(ID).maxPrice     = Utils.String2Double(MaxPriceBox.Text);
            Riders.AtID(ID).minPrice     = Utils.String2Double(MinpriceBox.Text);

            string price = StartpriceBox.Text;
            string size  = SizeBox.Text;

            PlaceInstruction instruction = new PlaceInstruction();

            instruction.OrderType = OrderType.LIMIT;

            LimitOrder order = new LimitOrder();

            instruction.Side        = Side.LAY;
            instruction.SelectionId = ID;

            order.PersistenceType = PersistenceType.PERSIST;

            order.Price = Utils.String2Double(price);
            order.Size  = Convert.ToDouble(size);

            instruction.LimitOrder = order;

            ApiSet.PlaceOrder(instruction);

            BackEnd.clock.Start();
            this.Dispose();
        }
示例#3
0
        private void clickButtonBack(object sender, EventArgs e)
        {
            string price = MaxPriceBox.Text;
            string size  = SizeBox.Text;;

            PlaceInstruction PlaceInstruction = new PlaceInstruction();

            PlaceInstruction.OrderType = OrderType.LIMIT;

            LimitOrder order = new LimitOrder();

            PlaceInstruction.Side        = Side.BACK;
            PlaceInstruction.SelectionId = ID;

            order.PersistenceType = PersistenceType.PERSIST;

            order.Price = Utils.RoundPrice(Utils.String2Double(price));
            order.Size  = Utils.String2Double(size);

            PlaceInstruction.LimitOrder = order;

            ApiSet.PlaceOrder(PlaceInstruction);

            BackEnd.clock.Start();
            this.Dispose();
        }
示例#4
0
        private void clickBack(object sender, EventArgs e)
        {
            BackEnd.clock.Stop();
            List <PlaceInstruction> placeInstructions = new List <PlaceInstruction>();
            PlaceInstruction        Instruction       = new PlaceInstruction();
            LimitOrder order = new LimitOrder();

            order.Price = Utils.String2Double(this.lay.Text);
            order.Size  = 5;

            Instruction.OrderType  = OrderType.LIMIT;
            Instruction.LimitOrder = order;
            Instruction.Side       = Side.BACK;

            Instruction.SelectionId = this.selectionID;

            placeInstructions.Add(Instruction);

            ApiSet.PlaceOrder(placeInstructions);
            BackEnd.clock.Start();
        }
示例#5
0
        /// <summary>
        /// Automatically overbids competitor prices according to manual set price maxima.
        /// </summary>
        public static void Update()
        {
            List <ReplaceInstruction> replaceInstructions = new List <ReplaceInstruction>();

            for (int i = 0; i < Riders.Count(); i++)
            {
                if (Riders.At(i).hasAutoOrder&& Riders.At(i).layorders != null)
                {
                    for (int j = 0; j < Riders.At(i).layorders.Count; j++)
                    {
                        if (Riders.At(i).layorders[j].SizeRemaining >= 2 && Riders.At(i).layorders[j].PriceSize.Price < Riders.At(i).marketBid)
                        {
                            LimitOrder Order = new LimitOrder();
                            Order.Price = Utils.RoundPrice(Riders.At(i).marketBid + Utils.Increment(Riders.At(i).marketBid));
                            Order.Size  = Convert.ToDouble(Riders.At(i).layorders[j].SizeRemaining);
                            ReplaceInstruction replaceInstruction = new ReplaceInstruction();
                            replaceInstruction.BetId    = Riders.At(i).layorders[j].BetId;
                            replaceInstruction.NewPrice = Utils.RoundPrice(Riders.At(i).marketBid + Utils.Increment(Riders.At(i).marketBid));
                            replaceInstructions.Add(replaceInstruction);
                        }

                        if (Riders.At(i).layorders[j].SizeRemaining >= 2 && Riders.At(i).layorders[j].PriceSize.Price > Riders.At(i).marketBid)
                        {
                            LimitOrder Order = new LimitOrder();
                            Order.Price = Utils.RoundPrice(Riders.At(i).marketBid);
                            Order.Size  = Convert.ToDouble(Riders.At(i).layorders[j].SizeRemaining);
                            ReplaceInstruction replaceInstruction = new ReplaceInstruction();
                            replaceInstruction.BetId    = Riders.At(i).layorders[j].BetId;
                            replaceInstruction.NewPrice = Utils.RoundPrice(Riders.At(i).marketBid + Utils.Increment(Riders.At(i).marketBid));
                            replaceInstructions.Add(replaceInstruction);
                        }
                    }
                }
            }

            ApiSet.ReplaceOrder(replaceInstructions);
        }
示例#6
0
 private void click_CancelButton(object sender, EventArgs e)
 {
     BackEnd.clock.Stop();
     ApiSet.CancelAll();
     BackEnd.clock.Start();
 }