Admin Posted November 24, 2018 Posted November 24, 2018 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 Quote
Admin Posted November 24, 2018 Author Posted November 24, 2018 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. Quote
Admin Posted November 24, 2018 Author Posted November 24, 2018 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. Quote
Admin Posted November 24, 2018 Author Posted November 24, 2018 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. Quote
Admin Posted November 24, 2018 Author Posted November 24, 2018 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 Quote
Admin Posted November 24, 2018 Author Posted November 24, 2018 2. Script execution 2.1 Full script code Next, we analyze it in more detail. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 2.2 Update Events This function is called every time then data is updated 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 Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 2.3 Select Favorite Function Api.Soccer.SelectFavorite(...) The function selected 16 teams from 254 events for which the conditions are met. Selection results are displayed in the schedule window. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 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. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 2.5 Live Score information Some markets do not have information about the Live Score of the match. We ignore such markets. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 2.6 Market status If the market is stopped, we are waiting for its opening. or Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 2.7 Time range We are waiting for the time to be in the specified interval. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 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 Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 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. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 2.10 Prices Check that the current price is in the specified interval. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 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. Quote
Admin Posted November 25, 2018 Author Posted November 25, 2018 If not use the operator continue then the script code could look something like this Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.