So, I have my first strategy in RE coded and I am in the middle of backtesting. The strategy trades a relative strength custom indicator with SPY as the underlying index....all EOD. The issue I run into is after several months/weeks of trading, I have multiple positions open with cash near zero. That is fine, until I receive a sell signal and buy signal on the same bar. I close the "sell" position at the next day's open, but RE does not recognize that I now have a cash balance, albeit available via temporary margin. As a result, the "buy" signal does not open until the next bar (day). I would very much like to close a position and open on the same bar the day after both the buy and sell signals are received.
Unfortunately, I do not yet understand Position Manager enough to know if I can essentially sell one position at the open, update available capital to reflect this sale, and then open a new position with the proceeds on the same bar.
Any help is much appreciated.
Wednesday May 11 2016 by