Jump to content
FORUM · BOTBEETLE
DAYTRADINGDEPORTIVO

Bet on OVER 0.5

Recommended Posts

I work in a Script, this is to place a bet on OVER 0.5 at a price of 1.05 with a stake of 5 in the programming window I was trying but it seems that my code has an error since the bet is not thrown I'm not sure if I select the Market over 0.5 correctly.

 

 //=========================================AJUSTE DE ORDEN======================================================================

        [Category("2. Order")]
        [DisplayName("Precio OVER 0.5")]
        public decimal OrderPrice { get; set; } = 1.05M;

        [Category("2. Order")]
        [DisplayName("Precio OVER 1.5")]
        public decimal OrderPrice2 { get; set; } = 1.28M;

        [Category("2. Order")]
        [DisplayName("Cantidad de Stake (10% from Balance)")]
        public decimal PercentSize
        {
            get { return _size; }
            set
            {
                if (_size == value) return;
                if (value <= 0 || value > 100) return;
                _size = value;
            }
        }
        private decimal _size = 5;
        
        //==============================================PARAMETROS DE SELECCIÓN===============================================================

        [Category("3. Conditions of Selection")]
        [DisplayName("Pecio de Over 1.5")]
        public decimal FavPriceLay { get; set; } = 1.30M;

        [Category("3. Conditions of Selection")]
        [DisplayName("Liquidez en el mercado, mas de")]
        public decimal TotalMatched { get; set; } = 1000;
        
        //===============================================CONDICIONES DE ENTRADA========================================================

        [Category("4. Conditions of Enter")]
        [DisplayName("Price BACK, less")]
        public decimal PriceHight { get; set; } = 1.20M;

        [Category("4. Conditions of Enter")]
        [DisplayName("Price BACK, greater")]
        public decimal PriceLow { get; set; } = 1.05M;


public override void UpdateEvents(List<Event> events)
        {

            List<RunnerCatalog> runners = Api.Soccer.SelectFavorite(events, FavPriceLay, TotalMatched);


            foreach(var runner in runners)
            {

                foreach (var ev in events.Where(x => x.IsChecked))
                {
                    // 4.2. In EVENT find market "OVER_UNDER_05"
                    var market = ev.MarketCatalogues.FirstOrDefault(x => x.Description.MarketType == "OVER_UNDER_05");

                    // 4.3. If not - continue 
                    if (market == null) continue;

                    // 4.4. If Status - CLOSED 
                    if (market.Status == MarketStatus.CLOSED)
                    {
                        // 4.5. If EVENT Is Expanded - Collapse
                        if (ev.IsExpanded)
                        {
                            ev.IsExpanded = false;
                            Api.Collapse(ev);
                        }
                        continue;
                    }

                    // 4.6. If Status - OPEN 
                    if (market.Status == MarketStatus.OPEN)
                    {
                        // 4.7. Conditions of Enter for Price BACk - (PriceEnterLess < Back < PriceEnterMore)
                        if (PriceHight > market.Runners[0].Back && market.Runners[0].Back > PriceLow)
                        {
                            // 4.8. We Check that we did not place order in this EVENT
                            if (!Events.ContainsKey(ev.Id))
                            {
                                // 4.9. Add EVENT to Dictionary
                                Events.Add(ev.Id, ev);

                                // 4.10. Write to LOG and place order
                                Api.Log($"Event:{ev.Name}; Runner:{market.Runners[0]}; Back:{market.Runners[0].Back};");
                                Api.PlaceLimitOrder(runner, Side.BACK,OrderPrice,PercentSize);
                            }
                        }
                    }
                }

            }






        }

 

  • Like 2

Share this post


Link to post
Share on other sites

To make it easier for the user to create scripts, I create functions, such as

Api.Soccer.SelectFavorite(...)

But I understand that I need to make a description of them. I'll do it a little later.

I will show you how to write a script without using them.

Share this post


Link to post
Share on other sites

You have two little mistakes.

- to see the markets OVER_UNDER they need to open it (expand)
- In order to send orders there must be the right market

image.thumb.png.2e7646aee78c19a369b31728d64ba191.png

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...