下記は前回までの記事。
how-to-make-stock-trading-system.dogwood008.com
注文が通らない理由が、だんだんわかってきた気がする。
- The current data has already happened and cannot be used to execcute an order.
If the logic in the strategy is something like:
if self.data.close > self.sma: # where sma is a Simple Moving Average self.buy()
The expectation CANNOT be that the order will be executed with the
close
price which is being examined in the logic BECAUSE it has already happened.The order CAN BE 1st EXECUTED withing the bounds of the next set of Open/High/Low/Close price points (and the conditions set forth herein by the order)
どうもこの辺が原因のような気がする。続けて調査する。