Backtrader Community

    • 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/

    Complex trading logic

    Indicators/Strategies/Analyzers
    2
    5
    426
    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.
    • Impulse Five
      Impulse Five last edited by

      Hello,
      I have a system prototype which uses break even and the trailing exit - which is activated on the future value of an indicator - can this be done? I mean - activate trailing stop-loss when indicator1 gives signal1? otherwise the trade should reach reach the dynamic stop-loss set at trade entry (multiple of Average True range) or exit with the breakeven after the price closes above entry (break-even activator signal - also activated after trade is placed - not at trade placement)?
      Can this be done?

      1 Reply Last reply Reply Quote 0
      • R
        rajanprabu last edited by

        @Impulse-Five said in Complex trading logic:

        which is activated on the future value of an indicator

        I don't understand this question. how can one predict the future value of a indicator ( if you mean Ichimoku otherwise )

        @Impulse-Five said in Complex trading logic:

        activate trailing stop-loss when indicator1 gives signal1?

        Yes its possible. I normally keep my stop loss in my code and send order when its triggered.

        @Impulse-Five said in Complex trading logic:

        otherwise the trade should reach reach the dynamic stop-loss set at trade entry (multiple of Average True range) or exit with the breakeven after the price closes above entry (break-even activator signal - also activated after trade is placed - not at trade placement)

        I trail my stop loss based on price movement , and I also have a threshold for activating it. but I keep my SL at system and not with broker.

        Essentially BT can fit your requirements.

        Impulse Five 1 Reply Last reply Reply Quote 0
        • Impulse Five
          Impulse Five @rajanprabu last edited by

          @rajanprabu

          thank you for your reply,,,

          I don't understand this question. how can one predict the future value of a indicator ( if you mean Ichimoku otherwise )

          I mean for example start trailing the position ONLY AFTER certain indicator gives the signal (for example when rsi goes above 60,,,,can it also be a custom indicator?) - otherwise keep the stop-loss and break-evens active - breakevenm is also activated ONLY after the price has closed above entry - this is possible also?

          1 Reply Last reply Reply Quote 0
          • Impulse Five
            Impulse Five last edited by

            I need to add that the trailing stop-loss is activated after a certain signal is given but the exit is sent to the broker AFTER the trailing stop-loss is triggered itself...can this be done? I was able to simulate this outside of python- not sure if backtrader can handle this?

            1 Reply Last reply Reply Quote 0
            • Impulse Five
              Impulse Five last edited by

              please advice if this can be done or a zipline cane achieve this?

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