Chapter 12: Using QuickDog Scripting Files and Building Your Own
Scripting - Definition - Using text files to create DIRECTIONS for QuickDog so that QuickDog can run automatically to BACKTEST, HANDICAP and SUPERTUNE for you while you are away from the computer.
WARNING!!! - This is a very advanced feature and can be almost like programming. It is NOT for everyone but we do want users to be aware of this feature and use it at your own risk/reward. We CAN NOT build scripts for you unless you would like to pay us for this service, and we can not correct the ones you create. We can provide examples, and you can use these examples to create your own. You will have to study and work at it.
Most of QuickDog is "point and click", and, while you might not always know what you are doing, you are always doing something. It's pretty easy to point and click after all. Scripting is more difficult as it requires you to WRITE commands that QuickDog will then read. It's like creating a recipe, giving step by step directions for making a cake.
Before beginning this Tutorial, please EXIT QUICKDOG, the RESTART QUICKDOG.
For purposes of this discussion we shall again return to our CC20001007 program which is a 13 race program. The user should then select the "Scripting" Menu Bar item.
See Figure 1 Below where Scripting has been selected by using the Menu Bar Item "Scripting".

Figure 1 - The Scripting Drop Down Menu
Scripting is an ADVANCED feature because most QuickDog Users are not programmers, and scripting is like programming. We've tried to make it straightforward and have provided examples of some scripts you might find helpful, but if you want to create your own scripts, well, you will be on your own but hopefully the samples will lead you in the right direction. In addition, you can consult other QuickDog users on the forum.
This tutorial explains how to edit, then select your scripts so that they will run while you go do something fun, like mow the grass! First, let's take a look at a sample script provided. Click on "Edit Script" and some sample script files will appear on the selection Menu.

Figure 2 - Sample Script Files
Select the line containing "GGSAMPLE". A notepad window will pop up and you will be looking at the script file.

Figure 3 - A Sample Script File - GGSAMPLE.SCRIPT
The first thing you should do is use the FORMAT feature of Notepad, to UNCHECK the WORD WRAP. You will then see each scripting command line by line the way QuickDog will read it. After you've done that, then we can look at each line, and perhaps you'll get a feel for how to use script files.

Figure 4 - Word Wrap TURNED OFF
Now that Word Wrap has been turned off, let's talk about QuickDog's Scripting "language".
First, QuickDog ignores all lines which begin with an ASTERISK character '*'. Notice the first 12 lines of this script file begin with an asterisk. These are referred to as COMMENT LINES and you can use them freely as notes to yourself. The 13th line is a BLANK LINE, and QuickDog will ALSO IGNORE all blank lines. So, you may use BLANK LINES to create spacing in your script file. You should read all the comment lines of our sample script files because they describe what the real script file lines do. What are "real" script file lines?
Those that don't have an asterisk at the beginning and are not BLANK. These are SCRIPT COMMANDS which QuickDog will perform when you "Run a Script File". And these commands are what YOU MUST UNDERSTAND in order to use scripting properly. Not using them properly can result in QuickDog doing things wrong, or even BOMBING OUT!!!
Though our samples include all the commands you may use in a Script File, we will explain them further here. The command is shown in BOLD letters, then it is explained. For examples of how it is used, see the sample script files included in QuickDog. There is also one example included for each description below. That sample is in BOLD letters after the "Ex:" characters. The best way to learn scripting is by using our sample scripts and making changes to them. When you do, make sure you RENAME the scripts to some name that you create as these scripts are included in the UPDATE versions of QuickDog. If you don't create your own scripts and use these names, like ggsample.script, then all your changes will be overwritten next time you download. Use notepad to change the name!! And be careful when using NOTEPAD as it defaults to placing a ".TXT" after every file, unless you change the file type box to ALL FILES.
Renaming Example: You EDIT ggsample.script. You want to change the name to pb.script because you've changed it to Palm Beach. Do a SAVE AS, a window will popup allowing you to change the name. Change the name to pb.script, then look below that name for the FILE TYPE box, and it will probably say *.txt, change this to ALL FILES before you SAVE!! Otherwise your file will be called pb.script.txt and QuickDog will NOT find it.
Script File Commands:
backtest - This command BACKTESTS the currently select method (see style command) and uses the multiple setup commands (races, dates, perf, grade, dist, etc.). Without any other words with this command, the assumption is you wish to tune all types of races, to create one track profile as identified by the other commands used already. However, you may tune various distances and grades using the backtest distances command.
backtest distances - This command allows you to specify a single distance, and all/some grades at that distance to BACKTEST several track profiles with only one scripting command. Ex: tune distances 5-16 grades M J D C B AA A will tune the track profiles for 5-16M, 5-16J, 5-16D, etc...
begin date - for BACKTEST/SUPERTUNE the starting date which defines what programs you wish to use. You may enter the mm/dd/yy value, for example, 05/16/03 or if you leave it blank, then it represents either the most recent date which is today's date, or the date of the oldest program you have. This depends on the value of the "set fwd" command (see "set fwd"). Ex: begin date 05/01/03
begin date minus - for BACKTEST/SUPERTUNE , rather than specific a date, you use "minus 10" to indicate 10 days before today's date. Ex: begin date minus 40
convert - perform a convert of the race programs/results charts which have been downloaded from the Internet. You must specify either a REBUILD or UPDATE. Ex: convert update will convert new programs/charts, and convert rebuild will rebuild your entire database using your .TAB files and any new programs/charts. If you want QuickDog merely to convert the downloaded files into ASCII, then use convert asciionly as a script command.
create base data - this command will tell QuickDog to calculate the base data for the track indicated by the last program mask command used. It will limit that to the dates specified in the number of variants races command. It will also limit that to the dates specified in the last begin date and end date command.
create base data all - this command will tell QuickDog to calculate ALL base data for ALL tracks in your database. It will limit that to the dates specified in the number of variants races command. It will also limit that to the dates specified in the last begin date and end date command.
create daily variants - this command will tell QuickDog to calculate all the Daily Variants indicated by the last program mask command used. It will limit that to the dates specified in the last begin date and end date command.
create daily variants all - this command will tell QuickDog to calculate all daily variants for ALL tracks in your database. It will limit that to the dates specified in the last begin date and end date command.
culling column commands - only available as a script command and used for BACKTESTING, these commands allow the user to set any column or columns of a CUSTOM METHOD so that QuickDog will only look at races in which its top pick in the race was ALSO the top pick in those particular columns. For instance, if you want to bet only races in which the top pick, also was the top pick in a particular column, for example, FASTEST TIME, then you would use the SET COLUMN COLUMN command to tell QuickDog the column number 1-8 that is labeled FASTEST TIME. You may set as many columns as you wish in this way, and QuickDog will only BACKTEST races where its top pick was also top pick in that column. Other culling column commands are - CLEAR ALL CULLING COLUMNS and CLEAR CULLING COLUMN. See the included SCRIPT FILE named "TOPDOG.SCRIPT" to learn about and test this feature..
dist - this command is used to select which track profiles you wish to SUPERTUNE or BACKTEST. You simply set dist no or dist yes. Setting dist no is the same as setting DISTANCE to no on the TRACK PROFILE setup display on the CONVERT menu. Ex: perf yes
download data - this script command will download all the programs and charts based on the contents of the \jaidogs\xdays.fil file. The xdays.fil file is a single line text file which contains 3 numbers. The first number is the number of days BACK to look for program and chart files. This number is typically limited to 30 days, but can be more if a track website does have more history available for races run at that track. The second number is the number of days forward. Typically tracks will nave no more than 1 or 2 days programs available. Obviously no results are available in advance. The third number is either 0 or 1. A zero means only download programs and charts that have not already been downloaded, and a one means to force all programs and charts to be redownloaded. A sample line, therefore, in the xdays.fil would be 5 1 1, which means 5 days back, 1 day forward, and force the redownload.
end date - for BACKTEST/SUPERTUNE the ending date which defines what programs you wish to use. It is entered in the same way the "begin date" is entered, and if left blank, represents the most recent or the oldest date of your data depending on the value of the "set fwd" command (see "set fwd"). Ex: end date 05/16/03
end date minus - for BACKTEST/SUPERTUNE and other commands using a date, rather than a specific date, you can specify "minus 10", for example, to mean the end date is today's date minus 10 days. Any number of days can be used. Ex: end date minus 10
export to access - this command will generate a comma separated file showing each Past Performance line for every horse running at either a specific track or all the tracks in your database. It also creates a results file which can be imported into Access or another database system. As an example, "export to access BM" would export all Past Performances for Birmingham into a comma separated file, along with another file showing all the results of these races at Birmingham. "Export to Access ALL" would output all PPs along with results to comma separated files.
export lines.txt - this command will generate a lines.txt file in the appropriate folder of the \dogpak folder based on the track ID provided. The other settings for this line are - TRACK ID, VARIANTS, SCHOOLING, TROUBLE. An example would be EXPORT LINES.TXT GG VARIANTS SCHOOLING TROUBLE, if you don't want VARIANT adjust times, leave that word out. If you don't want schooling races or troubled races, leave those words out. You MUST specify a TRACK ID. Prior to using this command you can set the "begin date" and "end date" commands to specify a date range.
export oof - this command will generate a tab delimited file in the EXPORTFOLDER folder based on previous scripting commands which can be used to select a date range, track id and performance designation. There are no other settings on this line. An example would be, simply, EXPORT OOF. Prior to using this command you must set the "begin date" and "end date" commands to specify a date range and use the SET FWD to select the order of the listed results. You must also use the PROGRAM MASK scripting command to select which race programs you wish to use to create the Order of Finish data for. The Order of Finish Data includes, Track ID, Date, Performance, Race Number, Grade, Distance, and Order of Finish. See the file "EXPORTOOF.SCRIPT" as an example for this scripting command.
export setup.txt - this command will generate a setup.txt file in the appropriate folder of the \dogpak folder based on the track ID provided. The other settings for this line are - TRACK ID. An example would be EXPORT SETUP.TXT GG. Prior to using this command you can set the "begin date" and "end date" commands to specify a date range.
export to tab - this command will generate a tab delimited program file showing each race in the selected race program, and the outings and data for each outing as you've requested it using the following commands (see "export to text" commands below). What you do is startup QuickDog, then select a race program, then use the SCRIPT feature to select your SCRIPT file containing these commands. Each command is given below and each is typed on the same line as the "export to tab" command. If you do not type any of these commands then you will get a "default printout" with none of the optional commands included. See the commands below the "export to text" command below. If you specify a number following this command then QuickDog will include that many past performance outings in the output program (or blank fill if none are available).
export to text - this command will generate a text program file showing each race in the selected race program, and the outings and data for each outing as you've requested it using the following commands. What you do is startup QuickDog, then select a race program, then use the SCRIPT feature to select your SCRIPT file containing these commands. Each command is given below and each is typed on the same line as the "export to text" command. If you do not type any of these commands then you will get a "default printout". If you specify a number following this command then QuickDog will include that many past performance outings in the output program (or blank fill if none are available). Otherwise see each command below -
variants - type this command if you want your times to be converted and output as the variant adjusted times.
schooling - this command will include schooling races.
trouble - this command will include troubled races
track_ratio - this command will use track ratios in the computing of times.
same_distances_only - only the outings with distances matching the race condition will be output.
same_track_only - only the outings run at the track in the race conditions will be output.
speedratings - times will be converted into speed rating number, rather than times in seconds.
fulll_date - the full MM-DD-YY will be output to the outing line.
use_date_range - the BEGINDATE and ENDDATE and FWDREV commands will be looked at to exclude outings based on date.
export_race_number - Include the race number in the past performance line (Available in the TAB DELIMITED Export).
grade - this command is used to select which track profiles you wish to SUPERTUNE or BACKTEST. You simply set grade no or grade yes. Setting grade no is the same as setting GRADE to no on the TRACK PROFILE setup display on the CONVERT menu. Ex: grade yes
initialize - This command will reset all the Weighting factors for a particular method to 1.0. You might use it prior to SUPERTUNING with you script file, but it is NEVER necessary. You may also set individual weighting factors using the set command along with the name of the weighting factor to use. See sample script files for those individual names. To use the initialize command, simply specify the name of the method. If you wish to initialize one of your own methods, use its name, but also put method = before the name. Otherwise, the method names to use are STANDARD, KNIFE, KNIFEADAPTED, MORGAN, and CONSENSUS. Ex: initialize MORGAN Ex: You own method initialize method = mymethod
method - the method of display in BACKTEST or SUPERTUNE. This has NOTHING TO DO WITH METHOD BUILDING!! Valid settings are A, B, or C, just as you do on the BACKTEST display. When using a B, you must also follow that up with a number from 1 to 8. Ex: method B 1
number of backtest races - this is pretty self explanatory. It's simply that NUMBER RACES setting you've been clicking in on the BACKTEST display. Ex: number of backtest races 200 means a maximum of 200 races will be used, but no races will be used outside of the begin and end dates, so you may get less than 200 races.
number of variants races - this is pretty self explanatory. It's simply that NUMBER RACES setting you've been clicking in on the Variants display for the creation of either your BASE DATA or Daily Variants (see the Help on VARIANTS for more information). Ex: number of variants races 9999 means a maximum of 200 races will be used, but no races will be used outside of the begin and end dates, so you may get less than 200 races.
perf - this command is used to select which track profiles you wish to SUPERTUNE or BACKTEST. You simply set perf no or perf yes. Setting perf no is the same as setting PERFORMANCE to no on the TRACK PROFILE setup display on the CONVERT menu. Ex: perf yes
profile - the profile command allows you to specify the folder where your initialization data and weighting factors will come from. The folder name must exist and will begin with the letters "TP_" and end with the name you provide in the command. Ex: profile testvalues This command will select and create if necessary, the folder tp_testvalues. All track profiles created after this point in the script file by way of SUPERTUNE will be created in this folder. This command will AUTOMATICALLY set the "read track profiles = yes" command (see below).
program mask - this command tells QuickDog which race programs (track/performance) to use when BACKTESTING/SUPERTUNING. When you use QuickDog, you first selected a TRACK, then you selected a race program, which was either Evening or Matinee, and BACKTEST/SUPERTUNE worked with these programs. This command is the way the scripting process makes these selections. Ex: program mask gg????????e means use all evening performances at Gulf Greyhound Park. You may change our sample scripts to fit your track by simply changing the TRACK ID.
read track profile - this command will read a track profile into QuickDog so that you can use SET COMMANDS to initialize or change some of the data within that profile. To use this command you must specify TRACK, PERFORMANCE, DISTANCE, and GRADE as in the following example. There is one space between each part of the command. You MUST SPECIFY all of these even if you don't use PERFORMANCE, DISTANCE and GRADE.
read track profile GG E 5/16 AA
quit - you may insert this command ANYWHERE within a script you are testing, to STOP IT! It is best, when building a script to write some of it, then test it, then write more, then test it. If you wish to learn from the scripts we've provided, then simply put the quit command anywhere in it to make it stop at any point, so that you can see what its done.
set - the set command is used to initialize all the settings you wish to use within a handicapping method. Once you have worked with a handicapping method, these settings should make sense to you. They have been named so that they should be easy to figure out. Below are shown lines from the "SCRIPTFILE.SCRIPT" file. These lines set your weighting factors. Note the names of the "variables" which are used. You must spell these out precisely or nothing will happen. Also note that these values will be changed by the SUPERTUNE process, which you can script using the tune command. See the SCRIPTFILE.SCRIPT file for the other set commands which are possible. For example, setting the number of races to use in the Standard Method - set S_RACES_CONSIDERED 12, etc. This command AUTOMATICALLY sets the "read track profiles = no" command.
* The following sets all weighting factors to 1.0 which is
* the same as the above INITIALIZE commands. But you can
* set whatever the values to whatever you want
*
SET S_WF_SPEED 1.0
SET S_WF_EARLY 1.0
SET S_WF_MAN 1.0
SET S_WF_LATE 1.0
SET S_WF_MONEY 1.0
SET S_WF_CLASS 1.0
SET S_WF_ODDS 1.0
* Set KNife Weighting Factors
SET K_WF_TIME 1.0
SET K_WF_BREAK 1.0
SET K_WF_EARLY 1.0
SET K_WF_LATE 1.0
SET K_WF_WPS% 1.0
SET K_WF_CLASS 1.0
SET K_WF_STARTS 1.0
SET K_WF_BESTTIME 1.0
* Set Knife Adaped Weighting Factors
SET KA_WF_TIME 1.0
SET KA_WF_BREAK 1.0
SET KA_WF_EARLY 1.0
SET KA_WF_LATE 1.0
SET KA_WF_WPS% 1.0
SET KA_WF_CLASS 1.0
SET KA_WF_STARTS 1.0
SET KA_WF_BESTTIME 1.0
* Set Morgan Displayed Weighting Factors
SET M_WF_PPP 1.0
SET M_WF_IGRD 1.0
SET M_WF_BRK 1.0
SET M_WF_18TH 1.0
SET M_WF_STR 1.0
SET M_WF_FIN 1.0
SET M_WF_GAIN 1.0
SET M_WF_FORM 1.0
SET M_WF_CLASS 1.0
SET M_WF_TIME 1.0
SET M_WF_BTIM 1.0
SET M_WF_WPS% 1.0
SET M_WF_%TRB"
*Set Morgan PPP Weighting Factors
SET M_WF_PPP_BRK 1.0
SET M_WF_PPP_18TH 1.0
SET M_WF_PPP_STR 1.0
SET M_WF_PPP_FIN 1.0
SET M_WF_PPP_GAIN 1.0
SET M_WF_PPP_FORM 1.0
SET M_WF_PPP_TIME 1.0
SET M_WF_PPP_BTIM 1.0
SET M_WF_PPP_WPS% 1.0
SET M_WF_PPP_%TBR 1.0
*Set Morgan INGRADE Weighting Factors
SET M_WF_INGRADE_BRK 1.0
SET M_WF_INGRADE_18TH 1.0
SET M_WF_INGRADE_STR 1.0
SET M_WF_INGRADE_GAIN 1.0
SET M_WF_INGRADE_FORM 1.0
SET M_WF_INGRADE_TIME 1.0
SET M_WF_INGRADE_BTIM 1.0
SET M_WF_INGRADE_WPS% 1.0
SET M_WF_INGRADE_%TBR 1.0
*Set Morgan Form Weighting Factors
SET M_WF_FORM_EARLY 1.0
SET M_WF_FORM_MID 1.0
SET M_WF_FORM_LATE 1.0
SET M_WF_FORM_FIN 1.0
*Set Morgan Gain Weighting Factors
SET M_WF_GAIN_EARLY 1.0
SET M_WF_GAIN_MID 1.0
SET M_WF_GAIN_LATE 1.0
*Set Consensus Weighting Factors
SET C_WF_STANDARD 1.0
SET C_WF_KNIFE 1.0
SET C_WF_KNIFE_ADT 1.0
SET C_WF_MORGAN 1.0
*Set Custom Method Filter Data
SET CM_MAX_RACES_CONSIDERED (# Races)SET CM_TABLE_INDEX_ROW N (Where N is the number of Rows in your Class
Table File)
SET CM_TABLE_INDEX_COLUMN N (Where N is Finish Position 1 through 8)
SET CM_EXCLUDE_SCHOOLING (Yes/No)
SET CM_EXCLUDE_TROUBLE (Yes/No)
SET CM_EXCLUDE_RACES_FROM_OTHER_TRACKS (Yes/No)
SET CM_EXCLUDE_DISTANCES_OTHER_THAN_TODAYS (Yes/No)
SET CM_USE_TRACK_RATIOS (YES/NO/DIS)
SET CM_USE_SURFACE_CONDITIONS (Yes/No)
SET CM_EXCLUDE_TRACK_CONDITION_FAST (Yes/No)
SET CM_EXCLUDE_TRACK_CONDITION_SLOW (Yes/No)
SET CM_EXCLUDE_TRACK_CONDITION_MUDDY (Yes/No)
SET CM_EXCLUDE_DOG_STALE_OUTINGS_WITHIN_DAYS (enter # of days)
SET CM_EXCLUDE_DOG_LONG_LAYOFF_WITHIN_DAYS (enter # of days)
SET CM_OVERRIDE_LONG_IF_SCHOOLING_OCCURED_RACES (enter # of races)
SET CM_OVERRIDE_LONG_IF_SCHOOLING_OCCURED_WITHIN_DAYS (enter # of days)
*
* Set Supertune Precision and Algorithm - First number (5 in the example)
* tells how many passe to make before quitting the SUPERTUNE process
* when none of the Weighting Factors change during the pass. For example,
* if QuickDog is supertuning a method, gets a high score, then goes through
* 5 more loops without getting a better result, then it will stop rather
* than go on to 100. If it does find a better value, then the count will
* start over again. The second number (1 in this example) gives the SUPERTUNE
* ALGORITHM to use. A '1' means H-L (HIGH TO LOW), '2' - Mean L-H (LOW TO HIGH)
* and nothing (or '0' - ZERO), means Top to Bottom Method - See the HELP file
* on the BACKTEST Menu for information on SUPERTUNE ALGORITHM.
SET SUPERTUNE_PRECISION 5 1
SET CLASS_TABLE_FILE \jaidogs\myclasstable.fil
SET SPEED RATING SELECTED YES (or NO)
set fwd (also set fwdrev) - For backtesting and
supertuning, this command sets the direction of
BACKTEST/SUPERTUNE from "begin date" forward to "end date"
or "begin date" backward to "end date". A "set
fwd 1" means that BACKTEST/SUPERTUNE will process races from the
"begin date" FORWARD day by day to the "end date".
This means that the "begin date" is earlier than the "end
date". A "set fwd 0" means that BACKTEST/SUPERTUNE will process
races from the "begin date" backward day by day to the "end
date". This will tell QuickDog that the "begin date" you
enter will be the most recent date, and that the "end date" you enter
will be the earlier date. Some users don't care the order in which the
results are tested, and some do. The fastest method is "set fwd
0". For reports such as EXPORT OOF script file command, this will
give the listed order of the data from MOST RECENT DATE to LEAST RECENT DATE if
you use the "set fwd 0" command, or LEAST RECENT DATE to MOST RECENT
DATE if you use "set fwd 1". Ex: set fwd 0 or set fwd 1
or set fwdrev 0 or set fwdrev 1
sub-methods - The Morgan method has 5 different areas that must be tuned to tune the entire method. This command selects which one you wish to tune. You may use gain, form, ingrade, ppp, or display or all/some of these. Ex: sub-methods gain form ingrade ppp will select these four sub-methods of Morgan to be tuned. Ex: sub-methods display will tune the display Morgan values.
style - this command selects the Method you wish to SUPERTUNE/BACKTEST or Handicap. Simply specify the method, STANDARD, KNIFE, KNIFEADAPTED, MORGAN, CONSENSUS or your own Custom Method name. If you are using your own method, use method = before the name of the method. Ex: style method = mymethod or style STANDARD
target - for a supertune operation, target is the A, B, C, D, etc. which corresponds to a "Target Value", that value you wish to MAXIMIZE when SUPERTUNING - See SUPERTUNE. Ex: target E means the value to maximize is the "wager 1 win %"
tune - This command SUPERTUNES the currently select method (see style command) and uses the multiple setup commands (races, dates, perf, grade, dist, etc.). Without any other words with this command, the assumption is you wish to tune everything to create one track profile. However, you may tune various distances and grades using the following command.
tune distance - This command allows you to specify a single distance, and all/some grades at that distance to SUPERTUNE several track profiles with only one scripting command. Ex: tune distance 5-16 grades M J D C B AA A will tune the track profiles for 5-16M, 5-16J, 5-16D, etc...
wager - simply set your wager as you did on the BACKTEST/SUPERTUNE displays but afterwards, enter the actual cost of the wager you wish to make. Ex: wager 12345/12345/12345 $1 means the wager you wish to BACKTEST/SUPERTUNE is a 12345 trifecta box using Quickdog's first 5 top picks for each race with a $1 wager.
As always we invite your questions and comments via e-mail - mikeg@quickreckoning.com
Copyright 2008 QuickReckoning.Com Last Updated on - 11/07/2008