This is my first question on stackoverflow so pleace have mercy with me.
I am using the R quantmod
and quantstrat
packages for backtesting trading strategies.
Unfortunately I cannot figure out how to implement a maximum period for a position. I what the position, short or long, to not last longer than say 5 days.
Thanks