- ago
One of the bullet points for Build 74 released a couple of days ago is:
Benchmark backtest will now reinvest dividends.

A couple of suggestions:
1. Make the div-reinvestment optional; this can be easily accomplished via a check box in Prefs - right next to the similar option for backtested symbols (could be further enhanced as Collect or Reinvest dividends).
2. Regardless of whether #1 above is implemented or not, if dividends are being reinvested in the Benchmark I think its important that they be displayed in Metrics Report in the appropriate field; currently they are not (a new field may be created as Collecting is not the same as Reinvesting).
0
242
Solved
11 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.81% )
- ago
#1
They’re already being reported as additional Positions (Position count.) We saw no reason to make this behavior optional. So we were able to thankfully avoid check-box preference creep this time around.
0
Cone8
 ( 25.44% )
- ago
#2
It is kind of optional though..
The Benchmark reinvest dividends only if you have checked "Collect Dividends.." in the Backtest Preferences.

Correction (2024-02-10) -
I misunderstood the implementation. The benchmark will always reinvest dividends, so there's no switch for that.
0
Best Answer
- ago
#3
@Cone,
Good to know they're still optional.

@Glitch,
QUOTE:
...being reported as additional Positions (Position count.)

With box for collecting dividends in Preferences UNchecked I opened and ran a blank C# strategy (symbol: SPY, benchmark: SPY), I saw 2 Positions listed for the benchmark (used to be, and ought to be, only 1 with divs not being reinvested):

The Avg Profit % also varies very slightly from value on top. Don't know if the two are related.

Maybe it's nothing but thought I'll mention them...
0
Glitch8
 ( 11.81% )
- ago
#4
It's possible that the price of the benchmark declined, or cash was added via interest, to a point where additional shares of the benchmark could be purchased. So, the re-investment actually goes above and beyond dividends.
0
- ago
#5
There should really be no reinvestment as that option has not been selected under Prefs.
Also, no interest or cash has been received as you can see in the pic above.
------------------

Additional Points:
- Position Count of 2 for the Benchmark (BM) is *only* present for backtest in Single Symbol mode; a Portfolio backtest always shows 1 Position (and correctly so)
- It appears the BM Position Count of 2 is only with symbols that pay dividends such as SPY, QQQ, and so on; using a non-div paying symbol for BM such as $SPXTR, BTC.USD, etc gives a correct Position Count of 1
- The discrepancy between the Avg Profit % reported at the bottom can sometimes be several % points away from the Profit % at the top whereas the two should be identical

You may wish to verify all of these on your PC.

There's something going on "under the hood" that I can't explain.
0
Glitch8
 ( 11.81% )
- ago
#6
Like I suggested earlier, the second position is the result of SPY declining and another 1 share position being able to be acquired. Precisely, on my 10 year test on Knife Juggler, the StartIndex is 20, with a basis price of 184.85. The following bar, SPY opened down at 184.58, so the Benchmark strategy still had some cash available.

On bar 21, another position was initiated (for 1 share) with a basis price of 185.82. It was filled at the open of the next bar at 186.29.

>>Position Count of 2 for the Benchmark (BM) is *only* present for backtest in Single Symbol mode; a Portfolio backtest always shows 1 Position (and correctly so)<<

Not true, what you're seeing is just the effect of those other benchmarks not happening to decline just enough to allow another position to have been bought.

>>It appears the BM Position Count of 2 is only with symbols that pay dividends such as SPY, QQQ, and so on; using a non-div paying symbol for BM such as $SPXTR, BTC.USD, etc gives a correct Position Count of 1<<

Not true, I duplicated the second position the same running on the Nasdaq 100 as on a single symbol. Both times the Benchmark runs were identical.

>>There's something going on "under the hood" that I can't explain.<<

It's understandable that a new behavior like this should be looked upon skeptically, but hopefully this peek "under the hood" has alleviated your concern.

To be clear, I followed the flow of the Benchmark strategy in the debugger to provide the precise reason the two positions were obtained.
0
- ago
#7
I stand behind my observations.

To avoid confusion and needless complexity, may I suggest:
For Benchmarking to the full extent possible in one swoop, allow the first (and only !!) position to use fractional shares of the benchmark.
If you think about it, it actually mimics real life e.g. if you were to place an order to invest $100k in, say, the symbol SPY the broker would buy round + odd lots + fractional shares to fulfill it to as near $100k as achievable. Many (? most) brokers allow you to specify a trade in $ value instead of the share quantity.

*Problem solved.*
0
Glitch8
 ( 11.81% )
- ago
#8
Could be an interesting enhancement, I tagged this as a #FeatureRequest to get it into the Wish List!
0
Glitch8
 ( 11.81% )
- ago
#9
Made a change here for Build 75, letting the benchmark strategy use Next Bar Open as basis price instead of Current Bar Close was sufficient to remove the offending second 1 share position. Not to say it was incorrect in the first place, but it's just less confusing this way.
3
- ago
#10
👍👍

I assume fractional shares are already implemented for dividend reinvestment (if the user chose that option).
0
Glitch8
 ( 11.81% )
- ago
#11
The benchmark will use fractional shares if the symbol has a Quantity Decimals > 0 defined in Markets and Symbols, or the data provider already defines Qty Decimals for the symbol > 0, like the crypto providers do.
0

Reply

Bookmark

Sort