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/

    Backtesting Live Ticks Possible?

    General Code/Help
    2
    4
    756
    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.
    • NewestTrader
      NewestTrader last edited by

      Hi,

      using ibtest.py --data0 EUR.USD-CASH-IDEALPRO --timeframe Seconds --compression 30 --port 7497 --replay seems to be the best way to

      • have live tick data
      • to get properly shaped live data candlesticks for candlestick periods that lie in the past (even without backfilling the data that came up before the script was started).

      (see: https://community.backtrader.com/topic/998/best-approach-for-live-trading-with-cheat-on-open/12# )

      My question is: during pure backtesting: is it possible to get the data in next() the same way as I get it during live trading?

      (so like this mix out of well shaped candlesticks and arbitrarily occuring "live" ticks)

      Thanks in advance!

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

        @newesttrader said in Backtesting Live Ticks Possible?:

        My question is: during pure backtesting: is it possible to get the data in next() the same way as I get it during live trading?

        Of course. Create a data feed which has that behavior and you will get it.

        1 Reply Last reply Reply Quote 0
        • NewestTrader
          NewestTrader last edited by

          @backtrader said in Backtesting Live Ticks Possible?:

          Of course. Create a data feed which has that behavior and you will get it.

          thanks for your reply, @backtrader , but I just wonder how I can do that?

          With every row in my csv file, len(self) in next() will increase by one from one call to next()to the following call.

          In contrast to that, during live trading len(self)only increases, when the next timeframe is reached. But in between, several ticks could have come up that do not lead to an increase in len(self).

          Big thanks in advance!

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

            If you have ticks in your data feed and you replay it to a larger timeframe, you will get that behavior too. But you need to have ticks stored, which is not the most usual setup.

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