For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

order executed with nan price

  • hello,

    I come into a situation that when orders are generated on a valid trading date (2017-10-18)
    However, the next day there's no price on the stock (suspension) but backtrader will try to create order on open (default behavior in bt) and it ends with nan in price and all pnl calculation such as broker cash/value etc.

    is there a way that backtrader can execute the order in the next valid trading day when this particular datafeed has price (i.e stock unsuspend) ?

    thank !

    2017-10-18T00:00:00, CLOSE 600406 CG Equity, price = 16.15,qty = 31783
    2017-10-19T00:00:00, SELL EXECUTED, Size: -31783.00, Price: nan, Cost: 502711.71, Comm nan, order ref: 103
    2017-10-19T00:00:00, OPERATION PROFIT, GROSS nan, NET nan

Log in to reply