Backtest oddity #796
-
TLDR: Problem Statement:
Code used to get the daily returns and put them into a csv is as follows:
The same code snippet is used for a DO backtest. What have I tried? My first thoughts were that my DB was corrupted. Has anyone else experienced this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
Best bet to debug this is to work backwards, or forwards, and try and work out where the extra data is creeping in. I'd set up a system with one trading rule and one instrument, and then step forward through the various stages. |
Beta Was this translation helpful? Give feedback.
-
This is getting interesting. So anyone using mongoDB ver 5.0.12 or 4.4.17 without issues? |
Beta Was this translation helpful? Give feedback.
-
I've been using 4.4.17 without issues for some time (over a year, I think).
However...I'm also using pymongo 3.11.3, and arctic 1.79.4, which are both
later versions than Rob recommends. I did these upgrades to resolve one or
more issues (not just on a whim). I remember that the pymongo upgrade was
specifically related to poor performance. The arctic upgrade might have
been related, or something entirely different, but I did do them both
around the same time (March 2021).
…On Sat, Oct 8, 2022 at 10:37 AM Rory Mackay ***@***.***> wrote:
This is getting interesting.
I am running mongoDB version 5.0.12 on one server and 4.4.17 on the backup
server.
I notice that in Rob's quickstart doc, that arctic is said not to run with
MongoDB >= 2.4.x <= 4.2.8 (via the link)
Is anyone else running a later version of Mongo?
The recommended version 4.2.8 is not available from Mongo, only 4.2.23
That however fails to install on Mint20 as it lacks a dependency that is
not available.
So anyone using mongoDB ver 5.0.12 or 4.4.17 without issues?
—
Reply to this email directly, view it on GitHub
<#796 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA3JWKV2UHGB2DGSNMUEZ2LWCGWM3ANCNFSM6AAAAAAQ5UTKLU>
.
You are receiving this because you are subscribed to this thread.Message
ID: <robcarver17/pysystemtrade/repo-discussions/796/comments/3829905@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
The following relates to the original question regarding returns flowing past the last data date, not the Mongo/artic discussion: Pysys ver 1.47 |
Beta Was this translation helpful? Give feedback.
The following relates to the original question regarding returns flowing past the last data date, not the Mongo/artic discussion:
Pysys ver 1.47
I have found the issue; and, yes, it does relate to costs.
For reference, I am running a back test using one instrument, BUXL, with the momentum16 rule, using data from 2000-01-01 to 2022-09-19.
When the back test gets to the point where it shows the message, “Calculating buffered subsystem positions” the problem occurs in the _pseudo_fills_for_year method of the pandlCalculationWithCashCostsAndFills class, at line 114 of the pandl_cash_costs.py module. This method creates a date list for each year by generating the same number of equally-spaced …