Database Handicapping Software- JCapper

JCapper Message Board

          JCapper 101
                      -- Few Questions

Home Register
Log In
By Few Questions
NYMike
3/25/2015
2:27:04 PM
In Wong's book he talks about the weight of the horse in regards to condition a lot. Is that data available from HDW for North American horses?

Is there anyway to have a UDM not fire if every horse in the race meets the criteria? Say you wanted to flag horses that were 8 years old and older. If it is a race with all 8 year olds it will flag every horse. Any way to prevent that?

Is there any way to have an SQL query disregard information below a certain point? If you want to check a UDM without some of the criteria but know you want to put it back, can you put it at the bottom and mark it to disregard so the query will still run and the data that you cut is easy to put back?

Thanks,

Mike

Reply
jeff
3/26/2015
5:12:38 PM


you wrote:

--quote:
"In Wong's book he talks about the weight of the horse in regards to condition a lot. Is that data available from HDW for North American horses?"
--end quote


my reply:
No. Weight of Horse data is not available here in North America like it is in Hong Kong. Compared to the Hong Kong Jockey Club, racing jurisdictions in North America do not appear to have any interest in transparency.






you wrote:

--quote:
"Is there anyway to have a UDM not fire if every horse in the race meets the criteria? Say you wanted to flag horses that were 8 years old and older. If it is a race with all 8 year olds it will flag every horse. Any way to prevent that?"
--end quote


my reply:
Actually there is. I think you asked a variation of this same question in another thread a few weeks back:
How To - UDM Questions

Here's a repost of my answer:


--quote:
"You wrote:
"5. When a horse has an age advantage"

my reply:
This one you actually CAN do in sql mode (completely) from inside of JCapper.

The strategy for getting it done involves creating a UserFactor that behaves as a direct translation of AGEOFHORSE - and from there using the Gap field for the F-Slot Number in your SQL Factor Setup that your UserFactor is assigned to.

Here's a link to a screenshot of the UPR Tools Interface where I've hand keyed the entries:
http://www.JCapper.com/MessageBoard/Avatars/UPRToolsAgeOfHorse.jpg

These are the steps...

In the UPR Tools Interface:

1. Delete all previous entries for the UserFactor you decide to use. For example, if you are going to use UserFactor1 for this, delete all existing UserFactor1 entries first.

2. Click the NEW button.

3. Key the name of your UserFactor into the GroupName field. Note that in the above linked to screenshot I am creating UserFactor1 and have keyed USERFACTOR1 into the GroupName field.

4. Key the name of the factor you will be replicating into the Factor field. Note that in the above linked to screenshot I am replicating AgeOfHorse and have keyed AGEOFHORSE into the Factor field.

5. Key a numeric 3 into the Behavior field and hit the tab key to move the cursor out of the Behavior field. As soon as the cursor leaves the Behavior field, the interface will auto change the value sitting in the Behavior field from "3" (without the quotes) to "3 translate" (again without the quotes.)

6. Select ALL* from the surface-dist drop down. Or, alternately, you can select a specific surface-dist category if that is your intent. (The important thing is to not leave the surface field blank.)

7. Check the Active box.

8. Click the SAVE button.

At this point, provided USERFACTOR1 is part of your sql factor setup, the next time you click the Calc Races button (or the Build Database button) AgeOfHorse, rankForAgeOfHorse, and GapFOrAgeOfHorse are going to be written to the appropriate numbered F-slot fields that your UserFactor is assigned to.

From there, to evaluate "When a horse has an age advantage" in the Data Window you would look at Gap for the numbered F-slot that your UserFactor is assigned to. And of course in a sql UDM you would use the GAP F-slot number field that your UserFactor is assigned to. (Behavior in the data for this field in sql mode is identical to that of the Age of Horse Gap field in playlist file mode.)

For example, if your UserFactor is assigned to slot F01 and the scale of weights and time of year at a track you are playing are such that you think a 3 year old has an advantage in terms of maturity combined with assigned weight - the following three lines of sql might be useful in a layering UDM:

AND TRACK = 'XYZ'
AND AGEOFHORSE = 3
AND GAPF01 < 0

The first line ensures your UDM is flagging horses at track code XYZ only. The second line ensures your UDM is flagging 3 year olds only. The third line ensures that the 3 year olds flagged by the UDM are racing against one or more starters older than 3.

Alternately, if time of year and scale of weights for a track you are playing is such that you think 3 year olds are up against it because of too much weight assigned given level of maturity - the same 3 lines of sql might be useful in a negative layering UDM.

Hint: If USERFACTOR1 (or the UserFactor that you use for this) is not part of your sql factor setup, here is a link to the 4 part web tutorial for modifying the sql factor setup:
http://www.jcapper.com/Article_AddJRating.html"
--end quote



Suppose you wanted to flag horses that were 8 years old and older.

You could do that by adding the following line of sql to the UDM Definition:

AND AGEOFHORSE >= 8

Also, and provided you had taken the steps (above) to create say UserFactor1 and had also added USERFACTOR1 to Slot# F01 in your SQL Factor Setup... then you could also do the same thing with the following line of sql:

AND VALF01 >= 8


Let's move on to the next case that you mentioned:
"If it is a race with all 8 year olds it will flag every horse. Any way to prevent that?"


The way to prevent that (at least the way that immediately came to me) is to work with AgeOfHorse numeric value and rank.

In this case, because UserFactor1 is a direct translation (Behavior3) of AgeOfHorse it behaves exactly the same as AgeOfHorse.

And because you have inserted UserFactor1 into Slot #F01 in your SQL Factor Setup: F01 in your SQL Factor Setup is a direct translation of AgeOfHorse and behaves exactly the same as AgeOfHorse.

In a race where the age for all of the runners is the same, in this case 8...

If you want to "prevent a UDM from firing" when it finds "a race with all 8 year olds" - I think you can make a UDM do what you are asking by adding something like the following block of sql text to the UDM Definition:

AND NOT (RANKF01=1 AND VALF01=8)
AND NOT (RANKF01=2 AND VALF01=8)
AND NOT (RANKF01=3 AND VALF01=8)
AND NOT (RANKF01=4 AND VALF01=8)
AND NOT (RANKF01=5 AND VALF01=8)
AND NOT (RANKF01=6 AND VALF01=8)
AND NOT (RANKF01=7 AND VALF01=8)
AND NOT (RANKF01=8 AND VALF01=8)
AND NOT (RANKF01=9 AND VALF01=8)
AND NOT (RANKF01=10 AND VALF01=8)
AND NOT (RANKF01=11 AND VALF01=8)
AND NOT (RANKF01=12 AND VALF01=8)
AND NOT (RANKF01=13 AND VALF01=8)
AND NOT (RANKF01=14 AND VALF01=8)
AND NOT (RANKF01=15 AND VALF01=8)
AND NOT (RANKF01=16 AND VALF01=8)
AND NOT (RANKF01=17 AND VALF01=8)
AND NOT (RANKF01=18 AND VALF01=8)
AND NOT (RANKF01=19 AND VALF01=8)
AND NOT (RANKF01=20 AND VALF01=8)


Notes:

a. Placement of parenthesis characters in the above block of sql text is crucial.

b. To make the expression easier to read next time you pull it up: Check the Auto Format OFF Box in the UDM Wizard before hitting the Save button.

c. The above block of sql text uses what programmers sometimes call the "brute force method" to handle rank for age of horse (or rank for F01) for every possible field size you will encounter. I spent a little time tinkering with a more elegant approach. However, I found myself spinning my wheels and decided to just go with the above code block.

If anyone else has a more elegant approach please feel free to chime in.







you wrote:

--quote:
"Is there any way to have an SQL query disregard information below a certain point? If you want to check a UDM without some of the criteria but know you want to put it back, can you put it at the bottom and mark it to disregard so the query will still run and the data that you cut is easy to put back?"
--end quote


my reply:
I do this all the time. But only when doing R&D in the Data Window.

Don't change the UDM Definition in the UDM Wizard (unless you actually want to make a permanent change to the UDM Definition.)

Instead, bring the UDM up in the Data Window. Then edit the sql expression in the Data Window's SQL Expression Tool and execute the edited sql expression.



-jp


.

Reply
Reply

Copyright 2018 JCapper Software              back to the JCapper Message Board              www.JCapper.com