Jump to content
FORUM · BOTBEETLE
Sign in to follow this  
Admin

Soccer - A bet on the favorite.

Recommended Posts

An example of the implementation of the script for football.
This script is just an example of how to automate trading and implement strategies.

The script is included in the project.  Where can I see the full source code

Version 5.23

 

favorite.png.cfd7e70d6ff0b5b1e244ef29f3221dbf.png

Share this post


Link to post
Share on other sites

1. Script Parameters

Parameters are variables that the program user can set in the program interface and change the logic of the script.

1.1. Name

In this block we set the type, name and description of the script, these parameters do not affect the operation. Logs and parameters will be saved under the specified name.

image.png.3930d1bcb7ed05719df7d15b7619d689.png

Share this post


Link to post
Share on other sites

1.2. Order settings

These are user variables. The variable OrderPrice (Default value = 1.01) will be used to set the bet price. Variable PercentSize (Default value = 10%)- will be used to calculate the size of the bet as a specified percentage of the balance. 

Size check does not allow the user to enter a value less than 0 and greater than 100. 

image.png.725ae2ceabb2189e3207c2dcfb674819.png

Share this post


Link to post
Share on other sites

1.3. Condition of selection

The script will select only markets where:

  • there is money in the market more than specified in variable TotalMatched (Default value = 1000) 
  • value LAY for football team is less than specified in variable FavPriceLay (Default value = 2.0) 

Important! The choice of a favorite occurs only before the transition of the market to LIVE.

image.png.9a44e97ca312ba9afd3aa08d85864bc1.png

 

 

Share this post


Link to post
Share on other sites

1.4. Conditions of Enter

The variables PriceHight (Default value = 1.11)  and PriceLow (Default value = 1.01)  set the price range when a bet can be made.

The variable TimeEnter  (Default value = 60)  determines the time of the match when the bet can be made

The variable TotalGoal (Default value = 2)   determines how many goals in the match can be scored to make a bet.

The variable AdvantageGoal  (Default value = 2)  determines what advantage the favorite should have

The fulfillment of these conditions means that the bet will be made only after 60 minutes of the match with the score 2:0 at the price of LAY from 1.01 to 1.11

image.png.de8990db5ac1a73b1c3aa533fd55c812.png

Share this post


Link to post
Share on other sites

2.2 Update Events

This function is called every time then data is updated

image.png.158e9f7562f04a9866560c290ed4a6f6.png

 

The input of the function is supplied with data from the schedule window. If you stop the program you can see the content of events

image.png.eb6114d0c133ea6340741f5ba4b85966.png

 

Share this post


Link to post
Share on other sites

2.3 Select Favorite

Function Api.Soccer.SelectFavorite(...) The function selected 16 teams from 254 events for which the conditions are met.

image.png.e977c4e4f959e06cdbf2cccf5f0c06ed.png

 

Selection results are displayed in the schedule window.

runnerselected.png.a82a1521eecc70daf31820942057e642.png 

 

Share this post


Link to post
Share on other sites

2.4 Protection 

These two functions work together. they protect from re-bid. Before you make a bet, we install protection on the team  Api.SetRunnerProtection(...) . The next time then function UpdateEvents(...) was called, we check Api.IsRunnerProtected(...) whether protection is installed or not. If so, then skip this team.

image.png.27a4d94847065f2f36610e8737618ff3.png

Share this post


Link to post
Share on other sites

2.5 Live Score information 

Some markets do not have information about the Live Score of the match. We ignore such markets.

image.png.262a917b7aa8583bdd800cd440987cff.png

 

Share this post


Link to post
Share on other sites

2.8 Score

Receiving the total number and the difference, we wait for the fulfillment of the specified condition, for example, 2:0 or 0:2

image.png.44801d27d46b133f5684869644be798d.png

Share this post


Link to post
Share on other sites

2.9 Size for order

This function calculates the size of the bet as a percentage of the available funds. If there is no money available, returns 0.

image.png.ad811590a37c4d0804df967e35e0b051.png

Share this post


Link to post
Share on other sites

2.11 Place Order

When all the conditions are met - we make a bet. We write to the log the conditions under which the bet was made.

image.png.7144612bcf010f6623c13646df953292.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×