Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    order executed with nan price

    General Code/Help
    1
    1
    31
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rollo1212 last edited by

      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
      
      1 Reply Last reply Reply Quote 1
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
      $(document).ready(function () { app.coldLoad(); }); }