Hi, Shrewd!        Login  
Shrewd'm.com 
A merry & shrewd investing community
Best Of MIBest OfAll BoardsThe Shrewd’m WeeklyLearn to InvestHow to Become Shrewd
Search
Shrewd'm.com Merry shrewd investors
Search
Best Of MIBest OfAll BoardsThe Shrewd’m WeeklyLearn to InvestHow to Become Shrewd


The week's question
In December 2024, in the thread "Re: BRK: Why Not XOM?", BreckHutHigh asked the members: "What about the long road trips with kids?" This week it is put to everyone again. The button below opens the small thread re-asking it - read what others have said so far, then give your own answer as an ordinary reply.
Answer this questionContinue to Shrewd'mThis note won't appear again
Investment Strategies / Mechanical Investing
Unthreaded | Threaded | Whole Thread (11) |
Author: lizgdal   😊 😞
Number: of 6131 
Subject: Re: Scatter of Dartboard Screen Results
Date: 07/27/23 10:37 AM
Post New | Post Reply | Report Post | Recommend It!
No. of Recommendations: 4
1. The exact definition of the mod function depends on the programming language. I would guess gtr1 is Floating-point Truncated similar to C fmod.

Using a different random number generator can show if there is a problem. The hash function takes a parameter from 1e-25 to 1e25:

from Excel: param0=10^(50*(RAND()-0.5))
Junk: hash(aprc,dspo(1),param0)

The random number generators using hash and mod have similar SDcg.

        Screen         yrs  Depth  SDcg  SDpop
Dartboard2023c80hash2 66 80 0.42 30
Dartboard2023c80hash4 66 80 0.45 32
Dartboard2023c80hash1 66 80 0.45 33
Dartboard2023c80hash3 66 80 0.46 33

Dartboard2023c80mod4 66 80 0.43 31
Dartboard2023c80mod1 66 80 0.46 33
Dartboard2023c80mod3 66 80 0.46 33
Dartboard2023c80mod2 66 80 0.48 35


gtr1.net: GTR1 Backtester - Dartboard2023c80hash1
gtr1.net: GTR1 Backtester - Dartboard2023c80hash2
gtr1.net: GTR1 Backtester - Dartboard2023c80hash3
gtr1.net: GTR1 Backtester - Dartboard2023c80hash4
gtr1.net: GTR1 Backtester - Dartboard2023c80mod1
gtr1.net: GTR1 Backtester - Dartboard2023c80mod2
https://gtr1.net/2013/?~Dartboard2023c80mod3:h253n...
https://gtr1.net/2013/?~Dartboard2023c80mod4:h253n...

The gtr1 glossary says: "the function mod first divides the investment's corresponding value in the field referenced by field_ref by divisor_num and truncates the resulting quotient to an integer; the product of divisor_num and the integral quotient is then subtracted from the investment's value in field_ref and the resulting difference (remainder) is assigned to the investment's value in the calling field."

The highest aprc in the S&P 1500 gtr1 data is now NVR $5235. The highest dspo is 24482. I checked the gtr1 numbers for a stock with a high aprc and high dspo, and the calculation looks correct. The 0.0003 difference is small compared to the 0 to 153 range of RandomA.

RandomA: mod(linear(1,dspo(1),23,aprc,97,trm(1,17)),153)

  ticker   dspo:1    aprc      trm:1,17    wgtSum   [RandomA]
LMT 20960 475.50 0.993621 31992.88 15.8809

manual calc check
dspo:1 23*aprc 97*trm:1,17 wgtSum
wgtSum: 20960 10936.50 96.38 31992.88
quotient 209 153 31977
remainder 15.8812
Post New | Post Reply | Report Post | Recommend It!
Print the post
Members reply directly to lizgdal here — and replies get answered. Reading is free; so is joining the conversation. Join Shrewd'm »
This community has written 6,115 posts about Mechanical Investing. The article-length ones it recommended most:
Dividend investing · 52 recs · 2025
Non-Mag7 screen · 34 recs · 2025
OT - Div yields and returns · 32 recs · 2024
Using AI to generate backtesting programs · 30 recs · 2025
Rankings for 19Dec2022 · 29 recs · 2022
Unthreaded | Threaded | Whole Thread (11) |


Announcements
Mechanical Investing FAQ
Contact Shrewd'm
Contact the developer of these message boards.

Best Of MI | Best Of | Favourites & Replies | All Boards | Followed Shrewds | Open Questions | Moving a community