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/

    Execute Market order on average price on BT

    General Discussion
    3
    8
    56
    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.
    • André Tavares
      André Tavares last edited by

      My data has average price along with OHLC.
      Is it possible to execute on the average price of the next day instead of the opening price of the next day?
      This will simulate an execution by the VWAP, since the VWAP is very close to the average price.
      I know I could feed the average price in place of the opening price, but this would mess indicators, for example ATR.

      run-out A 2 Replies Last reply Reply Quote 0
      • run-out
        run-out @André Tavares last edited by

        @André-Tavares said in Execute Market order on average price on BT:

        average price of the next day

        I'm not sure I'm following you. Do you want to execute your order on the average price of the current bar and previous?

        1 Reply Last reply Reply Quote 0
        • André Tavares
          André Tavares last edited by

          Next bar.
          What is the current behavior on a daily basis.
          Analyze on the current close price and send order. Order is executed on the open price of the following day.

          I want to:
          Analyze on the current close price and send order. Order is executed on the avarage price of the following day.

          1 Reply Last reply Reply Quote 1
          • run-out
            run-out last edited by

            That's going to be a bit tricky, since you can't calculate the average price until after close.

            1 Reply Last reply Reply Quote 0
            • André Tavares
              André Tavares last edited by

              I have the average price. I will include it with OHLC.

              1 Reply Last reply Reply Quote 1
              • A
                ab_trader @André Tavares last edited by

                @André-Tavares said in Execute Market order on average price on BT:

                Is it possible to execute on the average price of the next day instead of the opening price of the next day?

                Everything is possible in the backtests. You may want to use stoplimit order and specify your average price for price and plimit.

                Just wondering how are you going to make this in real life? Final VWAP price us not available till the end of the session. It seems for me as a future lookahead bias.

                1 Reply Last reply Reply Quote 0
                • André Tavares
                  André Tavares last edited by

                  In Real life I will use the broker order type that is VWAP. It executes during the day piece by piece. The final average price is close to the average price.
                  I think this is closer to reality than trading at open price. What do you think?

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    ab_trader @André Tavares last edited by

                    @André-Tavares I see, in this case it may work. But the accuracy of the backtest will depend on how average price is close to VWAP.

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