Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txnsim layering - needs to layer until target duration is achieved #70

Open
jaymon0703 opened this issue May 19, 2018 · 0 comments
Open
Assignees

Comments

@jaymon0703
Copy link
Collaborator

Currently in txnsim we layer until there are no more longdf or shortdf rows to sample from. Combined with the maxpos conditional check, it means replicate duration can fall well short of the original strategy long and short duration.

For an example, see below screenshot from the R/Finance 2018 CFP submission for Round Turn Trade Simulation, based on txnsim. We can see the original strategy long and short duration is way off to the right of the replicate duration distributions.

image

Fix will involve sampling until duration resembles that seen in the original strategy, whilst still maintaining a check for maxpos.

jaymon0703 added a commit that referenced this issue May 19, 2018
This commit has some significant changes to the way layering happens in the master branch. We layer until duration matches a predefined target, as opposed to only layering according to number of layers as determined by totaldur/calendardur.

The code is suboptimal, and while loops can run for a very very long time. Fixing this will be the subject of subsequent commits.

See #70

This commit also fixes #71
jaymon0703 added a commit that referenced this issue Dec 16, 2019
Strategies could be long only, and in rare and unlikely cases i suppose short only. This commit enables txnsim to work for long-only and short-only strategies.

see #70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants