blotter
blotter copied to clipboard
txnsim layering - needs to layer until target duration is achieved
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.

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