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/

    Risk management methods? pause trading when a maximum loss is incurred?

    General Code/Help
    2
    2
    569
    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
      Yelloww last edited by

      Hi all,

      I am wondering if I can pause trading for like 24 hours when a maximum loss is incurred in a day.
      I could check loss of the day in the next() method and then skip it, but is there a smarter way to do that?
      Thanks for help.

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

        There shouldn't be any smarter way, because your trading logic is in your next method (which may of course delegate to some other methods declared by you)

        Record the datetime at which you stop and don't trade again until 24 hours have elapsed.

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