newbie here.
self.buy(price=self.dataclose[1]) may help
newbie here.
self.buy(price=self.dataclose[1]) may help
Hi,
I try to use stoptrail in buy orders, but different values of parameters(trailpercent-trailamount) change execution day of buy order:
<<
self.order = self.buy(size = 100, exectype = bt.Order.StopTrail, trailpercent=0.02)
output:
2019-01-07 buy CREATE: 31120
2019-01-12 BUY EXECUTED @ Price: 31100 Cost: 3110000
self.order = self.buy(size = 100, exectype = bt.Order.StopTrail, trailpercent=0)
output:
2019-01-07 buy CREATE: 31120
2019-01-08 BUY EXECUTED @ Price: 31000 Cost: 9920000
with regular buy order(no stoptrail, market type) i get same result as last one which I understand must be correct one.(order executes the day after creating)
did I miss something?