In my script output you can see that on 2016-06-06 order to close previous position was issued by
self.close(), and at the same day new buy order was created by
self.buy(). Same happened on 2016-06-08: close long order issued, open short order issued. Since I use
.set_coc=True, then these orders are executed at the same day as they are issued. I've misspelled the following: SHORT CLOSED should be LONG CLOSED and LONG CLOSED should be SHORT CLOSED. But it is mistake in log string, not in the trading logic.
If I understand bt logic correctly, sizer value is calculated internally when the buy -
self.buy() - or sell -
self.sell() - order is issued. You don't need to call it somehow in the strategy.
I was thinking to use sizer for this, but I wasn't able to get separate trades. I got one trade with varying position size according sizing rules.