Hi,
while programming and btesting I have identified another thing that is surprising me.
E.g. when I use this signal here to go short:
if current_price*0.975 >= average_price and cash > current_price:
# Need to calculate how many shares we can buy
number_of_shares = 100
# Place the buy order (positive means buy, negative means sell)
order(DJ, -number_of_shares)
log.info("Buying %s" % ('DJ'))
It testing the if condition with the close price of the relevant period, which is like expected.
What seems strange is that the order function goes short with the closing price of the following period.
Is there any possibility to change this to the open price of the following period as this is the closest next price after the trigger? Wondering that this is not the default case actually.
Thanks