QuickHorse Online User's Guide

 

Top_Level_Menu_Bar

 

Help

Edit_Script

Run_Script

 

Custom Search

 

Editing a Script File

Definition Scripting - Many of the features that you select using the Cursor and Left Mouse button are accessible automatically by using a special "Scripting Language".  A Script is simply a set of written directions which are pre-defined to QuickHorse.  These directions are stored in a Script File, and then Run.   When "Run" these commands will automatically control QuickHorse while you are out mowing the lawn or out on a date.  Ok, maybe you want to go watch TV.  That's fine too!  Just know that your computer could be busy handicapping the next days races for you.

Figure 1 - The Scripting Menu Bar Item Drop Down Menu

There are only two commands (other than the HELP selection).  You are either going to "EDIT" a script file or you are going to "RUN" a Script file.

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 QuickHorse 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 QuickHorse will then read.  It's like creating a recipe, giving step by step directions for making a cake.

Scripting is an ADVANCED feature because most QuickHorse 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 QuickHorse users on the forum.  

The Scripting User's Guide section 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 "SAMPLE".  A notepad window will pop up and you will be looking at the script file.

Figure 3 - A Sample Script File - SAMPLE.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 QuickHorse 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 QuickHorse's Scripting "language".

First, QuickHorse ignores all lines that begin with an ASTERISK character '*'.  Notice the first 8 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 10th line is a BLANK LINE, and QuickHorse 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 QuickHorse 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 QuickHorse doing things wrong, or even BOMBING OUT!!!

The scripting commands are shown in BOLD letters, then each is explained.  For examples of how it is used, see the sample script files included in QuickHorse.  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 QuickHorse.  If you don't create your own scripts and use these names, like sample.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 sample.script.  You want to change the name to aqueduct.script because you've changed it to work with Aqueduct. Do a SAVE AS, and a window will popup allowing you to change the name.  Change the name to aqueduct.script, then look below that name for the FILE TYPE box, and it will probably say *.txt, so change this to ALL FILES before you SAVE!!  Otherwise your file will be called aqueduct.script.txt and QuickHorse will NOT find it.

Script File Commands:

backtest surfaces - This command allows you to specify one or more surfaces, ie, DIRT or TURF, to tune track profiles.  Example backtest surfaces DIRT distances 5f 6f grades A CO

backtest distances - 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 distances 5f 6f grades S CO A will tune the track profiles for 5f S, 5f CO, and 5f A, along with 6f S, 6f CO, and 6f A, etc.

Additional settings for Distances are used in the "tune" or "backtest" script instruction - In addition to furlong values, you can use the following text

SPRINT - races with distances under 1 mile (8f) are combined
ROUTE - races with distances 1 mile or greater are combined
S_SPRINT - races of distances between 4f and 5.5f are combined
L_SPRINT - races of distances greater than 5.5f but less than 1 mile are combined.

backtest grades - This command allows you to specify a single grade or many grades to SUPERTUNE several track profiles with only one scripting command.  Ex:  backtest grades S CO A will tune the track profiles for Special Weights, Optional Claiming and Allowance races. 

Additional Grade Codes are: 

claiming = C, MDN SP = S, MDN CLAIM = M,  starter alw = R, allowance = A,
NonGraded = N
, Grade I = G1, Grade II = G2, Grade III = G3

There are also Grade (Class) Levels and Grade (Class) Tiers which combine grades. For example, all Claiming races are Tier1, Allowance are Tier 2, and Stakes are Tier3

There are 10 Grade (Class) levels. Levels are broken down according to the way QuickHorse measures the Class of a race. Class is a number between 0 and 99 with 0 being lowest and 99 being highest. QuickHorse computes the class of a race when you use QuickHorse's free data. The Class Level breakdowns are 0-9 which correspond to the 10 decades between 0-99. Level 9 would be from 90-99, Level 0 is 0-9

To use Tiers or Levels as Grades specify 'T' or 'L' followed by a number. 1 - 3 for Tiers, and 0 - 9 for Levels. For example:
Tier 1 - "T1" or Level 5 - "L5"

As mentioned above in doing so you are combining races based on the calculated Class Values of QuickHorse.

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.  This depends on the value of the "set fwd" command (see "set fwd").  If you do specify this date, then the date you specify must be earlier than the END DATE entered unless the END DATE entered is blank.  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 data files contained in the \jaihorse\rebuild folders and any new programs/charts (if using PAY DATA).

dist - this command is used to select which track profiles you wish to SUPERTUNE or BACKTEST.  You can provide the same options as those that appear when you are configuring your track profiles using the DISTANCE setting.  These are OFF, ON. SPRINTS, SP/RTE.  For example, you simply set dist no or dist yes or dist sp/rte or dist sprints.  Setting dist no is the same as setting DISTANCE to no on the TRACK PROFILE setup display.

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 AQU" would export all Past Performances for Aqueduct into a comma separated file, along with another file showing all the results of these races at Aqueduct.  "Export to Access ALL" would output all PPs along with results to comma separated files.

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").  The END DATE you specify must always be more recent than the BEGIN DATE you specify unless the BEGIN DATE you entered is BLANK.  Ex: end date 05/16/03

end date minus - for BACKTEST/SUPERTUNE, 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

grade - this command is used to select which track profiles you wish to SUPERTUNE or BACKTEST.  You simply set grade NO, YES, TIER, or LEVEL, or TYPE.  Setting grade no is the same as setting GRADE to no on the TRACK PROFILE setup display on the Track Profile setup menu.  If you select YES, or TYPE, the Quickhorse creates track profiles based on the grade of race shown in a race's chart.  For example, CO, or A, or N, or G1, G2, G3, etc.  If you select GRADE TIER, then a race is categorized as to the 3 Tier Levels computed by QuickHorse 0-50 is Claiming or Tier 1 (T1), 5-80 is Tier 2 (T2), and beyond 80 to 100 is Tier 3 (T3).  If you use Level, then races are tuned by QuickHorse's grading algorithm by "decades".  For example, by L1 - 0-10, L2 10-20, L3 20-30.  As you may notice using different selections slices up the track profiles.  For example, if you use GRADE LEVEL then you could have 10 different track profiles at one track for a specific distance run.  Ex: grade yes

handicap or superhandicap - these commands will either produce a text file of the handicapped program it refers to, or it will first superhandicap that race program before generating the handicapped program in a text file.  You may also specify a particular single race of a specific track and date.  This command takes several parameters.  In order for either command to work, the race program must be specified and there must be a specification of the date of that program.  In general the following script line works every day and you need not change the script file.

handicap CT???????? today tipsheet

This example will handicap today's program at Charles Town.  In place of today, you may also use "tomorrow" or even "yesterday" though that's probably not going to help you much.  The "superhandicap" command can be substituted for the "handicap" command.  If instead of using "today", "tomorrow", or "yesterday" which are all relative to the actual date the script if run, you wish to specify a specific date, then rather than "CT????????" use that date in YYYYMMDD format.  An example would be:

handicap CT20140110 tipsheet

The results of these commands is a "Tipsheet" for the date desired and all tipsheets (text files generated) are stored in the c:\jaihorse\tipsheets folder.  These files are named based on Track, Method, and date so they'll be easy to figure out.

One particular user of QuickHorse who designs 3rd party software for QuickHorse users desired that QuickHorse be able to generate individual race "tipsheets", so there is another way to script these two commands to that individual races are either handicapped or supertuned.  As in this example:

handicap race=01 track=CT date=20140110 method=APRCJ

To use this script line, the key is the identifier "race=".  If this is found then the other items, "track=", "date="  and "method=" must be on the same line.  Note there are NO SPACES between the identifiers of race, track, date, method and the = sign and no spaces after the = sign.  In place of "method=" you may specify "standard" if you want to use the Standard Handicapping Method (which is not a Custom Method).  

It is very important to know, as well, that in this very specific single race command, the output file is always the same file - c:\jaihorse\printfile.txt - therefore always follow up this command in your script with some way to process that file as otherwise the next similar command will replace this file.

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.

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.  

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.

select track - This command selects the TRACK to be used for subsequent Scripting Commands.  Simply specify the track id, for example, PIM is Pimlico.

set - the set command is used to initialize all the settings you wish to use within the currently selected Track Profile as well as other settings you may wish to use which are then in force for all track profiles.  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.  All of these scripting commands begin with the command "set ".  

These following scripting commands set your weighting factors within a track profile.   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.  Ex:  set s_wf_dr-sr 25 (sets the Standard Method Column "DR-SR" Weighting Factor to 25.  You may also use the expression DNU or USE rather than a value such as 25.  These values are familiar to you as well from manually setting weighting factors.  Ex:  set cm_wf_column_4 DNU (sets the 4th column weighting factor of the currently selected custom method to "Do Not Use".

Standard Method Weighting Factor "Variables" - S_WF_POWER, S_WF_E1, S_WF_E2, S_WF_LATE, S_WF_BR-SR, S_WF_DR-SR, S_WF_QH-RT

Custom Method Weighting Factor "Variables" - CM_WF_COLUMN_1, CM_WF_COLUMN_2, CM_WF_COLUMN_3, CM_WF_COLUMN_4, CM_WF_COLUMN_5, CM_WF_COLUMN_6, CM_WF_COLUMN_7, CM_WF_COLUMN_8

Another group of set commands set filters for a Track Profile.  These commands can be found on the "Set Method Filters" display and you should be able to correlate the following commands with the items you have manually set using that display.

MAX_RACES_CONSIDERED, MIN_RACES_CONSIDERED, NO_RACES_OLDER_THAN_NUMBER_DAYS, EXCLUDE_HORSE_SHORT_LAYOFF_WITHIN_DAYS, OVERRIDE_SHORT_IF_WORKOUTS_OCCURED_RACES, OVERRIDE_SHORT_IF_WORKOUTS_OCCURED_WITHIN_DAYS, EXCLUDE_HORSE_LONG_LAYOFF_WITHIN_DAYS, OVERRIDE_LONG_IF_WORKOUTS_OCCURED_RACES, OVERRIDE_LONG_IF_WORKOUTS_OCCURED_WITHIN_DAYS

Each of these commands requires a value after the command.  Ex: set max_races_considered 10 (this filter value will be set to 10 races).

Other filters simply require a YES, NO.  These filter commands are -

EXCLUDE_TROUBLE, EXCLUDE_RACES_FROM_OTHER_TRACKS, EXCLUDE_DISTANCES_OTHER_THAN_TODAYS, USE_SURFACE_CONDITIONS, EXCLUDE_TRACK_CONDITION_FAST, EXCLUDE_TRACK_CONDITION_SLOW, EXCLUDE_TRACK_CONDITION_MUDDY, EXCLUDE_TRACK_CONDITION_WETFAST, EXCLUDE_TRACK_CONDITION_GOOD, EXCLUDE_TRACK_CONDITION_FIRM, EXCLUDE_TRACK_CONDITION_YIELDING, EXCLUDE_TRACK_CONDITION_SOFT

Ex: set exclude_track_condition_yielding yes (could be yes or no)

set supertune_precision (includes supertune algorithm) - This command sets the Supertune Precision Value and the Supertune Algorithm (see Backtest Display).  The command is followed by 1 or 2 values.  The first value is interpreted as the supertune precision (value of 1 to 10), and the 2nd value is the Supertune Algorithm (value of 0, 1, or 2 - 0 is Top to Bottom, 1 is Highest to Lowest, and 2 is Lowest to Highest - if no value, then the setting defaults to Top to Bottom).   Ex: set supertune precision 10 2 (this command will set the precision to 10 and the algorithm to "Lowest to Highest".

set  fwd or set fwdrev - Set the direction of BACKTEST/SUPERTUNE from "begin date" forward to "end date" or "end date" backward to "begin date".  A "set fwd 1" means that BACKTEST/SUPERTUNE will process races from the "begin date" FORWARD day by day to the "end date".   A "set fwd 0" means that BACKTEST/SUPERTUNE will process races from the "end date" backward day by day to the "begin date".  When creating the BEGIN DATE and END DATE, then END DATE is always more recent than the BEGIN DATE regardless of the direction set by this command.  Some users don't care the order in which the results are tested, and some do.  The fastest method is "set fwdrev 0".  Ex:  set fwd 0 or set fwdrev 1

style - this command selects the Method you wish to SUPERTUNE/BACKTEST or Handicap.  Simply specify the method, STANDARD,  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

supertune all track profiles - this command will look for track profiles in the currently selected track profile folder and supertune them.  This command will automatically set up the track profile settings according to the name of each track profiles.  At the end of this command's execution, the track profile settings will remain those of the last track profile found and supertuned.  Some things that are not set by this command - the Track Profile folder, the number of races to use to supertune, the wager to be tuned, the target value (like ROI) that will be tuned.

surface - this command is used to select which track profiles you wish to SUPERTUNE or BACKTEST.  You simply set surface no or surface yes.  Setting surface no is the same as setting SURFACE to no on the TRACK PROFILE setup display.  Ex: surface yes

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 %"

track condition - Select the Track Condition so that only races run under  this condition of track is used. QuickHorse will automatically  convert this condition based on surface. For example a FAST on  DIRT is FIRM on TURF. You can also specify "ALL" meaning that QuickHorse will use all the races in Supertune.

TRACK CONDITION ALL


Other TRACK CONDITIONS ARE:
WET FAST
GOOD
SLOPPY
MUDDY
FIRM
YIELDING
SOFT
ALL

Use ALL if you don't care what the condition is and you want to use all races regardless of track condition.

tune - This command SUPERTUNES the currently selected 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 surfaces - This command allows you to specify one or more surfaces, ie, DIRT or TURF, to tune track profiles. You may use this single line to designate all Surfaces, Distances, and grades to be tuned in a single method. However, the length of the line should be kept to a maximum of 200 characters.   Example tune surfaces DIRT distances 5f 6f grades A CO

tune distances - 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 5f 6f grades S CO A will tune the track profiles for 5f S, 5f CO, and 5f A, along with 6f S, 6f CO, and 6f A, etc. 

Additional settings for Distances are used in the "tune" or "backtest" script instruction - In addition to furlong values, you can use the following text

SPRINT - races with distances under 1 mile (8f) are combined
ROUTE - races with distances 1 mile or greater are combined
S_SPRINT - races of distances between 4f and 5.5f are combined
L_SPRINT - races of distances greater than 5.5f but less than 1 mile are combined.

tune grades - This command allows you to specify a single grade or many grades to SUPERTUNE several track profiles with only one scripting command.  Ex:  tune grades S CO A will tune the track profiles for Special Weights, Optional Claiming and Allowance races.

Additional Grade Codes are: 

claiming = C, MDN SP = S, MDN CLAIM = M,  starter alw = R, allowance = A,
NonGraded = N
, Grade I = G1, Grade II = G2, Grade III = G3

There are also Grade (Class) Levels and Grade (Class) Tiers which combine grades. For example, all Claiming races are Tier1, Allowance are Tier 2, and Stakes are Tier3

There are 10 Grade (Class) levels. Levels are broken down according to the way QuickHorse measures the Class of a race. Class is a number between 0 and 99 with 0 being lowest and 99 being highest. QuickHorse computes the class of a race when you use QuickHorse's free data. The Class Level breakdowns are 0-9 which correspond to the 10 decades between 0-99. Level 9 would be from 90-99, Level 0 is 0-9

To use Tiers or Levels as Grades specify 'T' or 'L' followed by a number. 1 - 3 for Tiers, and 0 - 9 for Levels. For example:
Tier 1 - " T1" or Level 5 - " L5"

As mentioned above in doing so you are combining races based on the calculated Class Values of QuickHorse.

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 QuickHorse's first 5 top picks for each race with a $1 wager.

 

Copyright © 2006-2020 QuickReckoning.Com
Last modified: May 01, 2018