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/

    Buying the open of the first candle

    General Code/Help
    3
    3
    391
    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
      Rstrong last edited by

      Hello,

      I am running filtered data through a backtrader script in which I am buying the open of the first candle of every data set I put it through.

      Is there a way to have backtrader do this without using cheat on open? If I use it then I have problems when trying to simulate exiting the position.

      B 1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by ab_trader

        Backtrader executes market orders on the next bar open by default, without any cheats. But no next bar open price legitimately available in this case since it is the information from the future.

        1 Reply Last reply Reply Quote 1
        • B
          backtrader administrators @Rstrong last edited by

          @rstrong said in Buying the open of the first candle:

          Is there a way to have backtrader do this without using cheat on open? If I use it then I have problems when trying to simulate exiting the position.

          No. Which problems?

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
          $(document).ready(function () { app.coldLoad(); }); }