Пример #1
0
 private void doubleclickDiscard(object sender, EventArgs e)
 {
     BackEnd.clock.Stop();
     for (int i = controlRank; i < Riders.Count(); i++)
     {
         Riders.discard(Riders.At(i).selectionID);
     }
     BackEnd.clock.Start();
 }
Пример #2
0
        static private void updateExpectedProfit()
        {
            double expectedProfit = 0;

            for (int i = 0; i < Riders.Count(); i++)
            {
                expectedProfit += Riders.At(i).pnl / Riders.At(i).latestMarketprice;
            }

            expectedProfit_ = expectedProfit;
        }
Пример #3
0
        static public void Update()
        {
            pdf = new Dictionary <double, double>();

            for (int i = 0; i < Riders.Count(); i++)
            {
                if (!pdf.ContainsKey(Riders.At(i).pnl))
                {
                    pdf.Add(Riders.At(i).pnl, 0);
                }
            }

            for (int i = 0; i < Riders.Count(); i++)
            {
                pdf[Riders.At(i).pnl] += 1 / Riders.At(i).latestMarketprice;
            }

            updateExpectedProfit();
            updateStandardDeviation();
            updateKurtosis();
        }
Пример #4
0
        public static void Update()
        {
            headerPanel.update();

            for (int i = 0; i < Math.Min(riderPanels.Count, Riders.Count()); i++)
            {
                riderPanels[i].selectionID = Riders.At(i).selectionID;
                riderPanels[i].rider.Text  = Riders.At(i).name.Split(' ')[Riders.At(i).name.Split(' ').Count() - 1];
                riderPanels[i].price.Text  = Riders.At(i).latestMarketprice.ToString();
                riderPanels[i].PNL.Text    = Math.Round(Riders.At(i).pnl).ToString();

                if (Riders.At(i).isOpen)
                {
                    riderPanels[i].StatusButton.BackColor = Color.Green;

                    if (Riders.At(i).isInthemoney)
                    {
                        riderPanels[i].StatusButton.BackColor = Color.Purple;
                    }
                }
                else
                {
                    riderPanels[i].StatusButton.BackColor = Color.Red;
                }

                riderPanels[i].overround.Text = Math.Round(Riders.At(i).overround, 2).ToString();
                riderPanels[i].turnover.Text  = Math.Round(Riders.At(i).Turnover(), 0).ToString();
                riderPanels[i].lay.Text       = Riders.At(i).marketBid.ToString();
                riderPanels[i].back.Text      = Riders.At(i).marketAsk.ToString();
                riderPanels[i].melay.Text     = Riders.At(i).myBid.ToString();
                riderPanels[i].meback.Text    = Riders.At(i).myAsk.ToString();
            }

            for (int i = Riders.Count(); i < riderPanels.Count; i++)
            {
                riderPanels[i].Dispose();
            }
        }
Пример #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);
        }