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/

    feeding sizer with stop loss value

    General Code/Help
    2
    2
    30
    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.
    • P
      Peixoto last edited by

      Hi, I have my strategy that predicts an entry point for a trade, after it predicts a stop loss and a take profit to exit the trade, so far so good.
      My issue appears on the sizing and leverage part.

      My goal is to, when I hit the stop loss I should lose 1% of my bank(can ignore commissions, slippage... , will deal with that later).
      I was hoping I could take leverage and sizing to achieve this goal, but I cannot find a way to feed the custom sizer with data from my strategy.

      basically, my sizing and leverage are dependent on the stop loss, but I am having an issue sending my stop loss value to the costume sizer.

      any suggestions on how to pass my stop loss and take profit values to the sizer?

      Best Regards

      E 1 Reply Last reply Reply Quote 0
      • E
        EMR @Peixoto last edited by

        @peixoto Not 100% sure of what you want to achieve (maybe the relevant part of your code would help to understand better) but have you considered to specify size=xxx in your orders, or tried to use setsizer (see https://www.backtrader.com/docu/sizers/sizers/) before each position ?

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