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/

    SessionFilter removing too many candlesticks, creating wrong trades?

    General Discussion
    2
    2
    23
    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.
    • Jeffrey C F Wong
      Jeffrey C F Wong last edited by

      Hi everyone, for my backtest, I specified the trading hours and used session filter to process what I need (9:00EST to 15:30EST). My strategy also uses bracket orders (take profit / stop loss). What I noticed is that with session filter on, any candles not within the specified hours is removed from the plot. So, my last trade on Day1 will gap up/down based on the first bar of Day 2 even though it could've been filled by 16:00EST of Day1. Is there anyway of not removing the candles with session filter or force close the trade before the next day? Any other suggestions will also be highly appreciated :)

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

        You can certainly put a code in next that checks the time, and after a certain time, close all orders.

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