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/

    cheat-on-open with live brokers

    General Discussion
    2
    2
    649
    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.
    • Y
      yangnw last edited by

      There is a certain strategy that makes decisions with pre-opening prices at time prior to market opening, and place orders at open.

      The backtesting can be done by using cheat-on-open. Now, suppose I have an external live source for such pre-opening prices. To live trade the strategy, the live broker should call next_open() some time before the opening of next bar, but without the opening price data updated (since they are unknown), unlike with bbroker. The difference should be quite clear.

      The difficulty mostly lies in specifying a particular clock time, so that the live broker can call the method prior to market opening by that much of time. I've looked and can't see how this can be implemented easily.

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

        That's why the name was chosen: cheat. Because you look at the opening price which you shouldn't have access to. It is meant for a study, research, but if you use to validate your strategy, you are cheating yourself.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors