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/

    While backtesting is there a way to assume that I buy at limit price instead of close price?

    General Code/Help
    4
    6
    99
    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.
    • Suraj Thorat
      Suraj Thorat last edited by

      Sorry if I have missed some part of the documentation but I can't find a way to tell cerebro to buy on limit price.
      I am trying to backtest a strategy on daily data. Cerebro either buys on next day's close price or buys on current days close price using cheat on close.
      It would be great if someone can help me.
      If this is not possible is it possible to get 15 minute data and run a EOD daily strategy on it and buy on 15 minute data to decrease slippage in backtesting?
      Thanks in advance.

      tianjixuetu 1 Reply Last reply Reply Quote 0
      • tianjixuetu
        tianjixuetu @Suraj Thorat last edited by

        @Suraj-Thorat you can use limit order or use multi timeframe data

        Suraj Thorat 1 Reply Last reply Reply Quote 1
        • Suraj Thorat
          Suraj Thorat @tianjixuetu last edited by

          @tianjixuetu Even if I place a limit order the order is executed on close price right? Not on limit price. I wanted a way in which the order is executed at limit price I specify.

          A 1 Reply Last reply Reply Quote 0
          • A
            ab_trader @Suraj Thorat last edited by

            @Suraj-Thorat if you put the limit order in correct way, than it is executed at limit price.

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

              Not always. It can be executed at a better price if the price gaps in the direction of the order (buy/sell), but never at a worst price and of course, by no means at something arbitrary like the close

              1 Reply Last reply Reply Quote 1
              • Suraj Thorat
                Suraj Thorat last edited by

                I might've missed something. I will check it out once more and get back to you. Really appreciate the help I am getting from the community. Thanks a lot. Really appreciate it.

                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(); }); }