I have searched the archives but not have found any concrete examples or instructions on how to hedge a portfolio in the backtester.
The example code for pairs trading is along the lines of the concept, except it is limited to the buy ticker being fixed whereas that is not the case with a portfolio. I've tried to set a static flag after the buy condition is true so the short code will know to execute when the underlying becomes the hedge ticker, but this does not seem to work. Any ideas?
