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/

    How to generate CrossOver signal with "slowK and slowD" from TALIB and or BT Stochastic fonction ?

    Indicators/Strategies/Analyzers
    3
    8
    5323
    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.
    • G
      GwadaMan last edited by

      Hello gas !!!

      I discover BT tool with Remroc.
      Could you please help me to find out the solution to display CrossOver signal coming from "slowK and slowD" of TALIB Stochastic fonction ?

      0_1488758498520_upload-571c6959-4b51-497c-bfa0-9d06061c253a

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

        In Unix everything is a file and in backtrader (mostly) everything is a lines object.

        Both Stochastic indicators (own and from ta-lib) declare lines.

        • Docs - ta-lib Indicator Reference : slowK and slowD
        • Docs - Indicator Reference : percK and percD

        Lines are reachable under lines attribute as in:

        percK = Mystochastic.lines.percK
        

        And backtrader contains an indicator to generate signals: CrossOver. There was a recent blog post using it (actually mixing with numbers).

        • Blog - Crossing Over Numbers

        In the docs you can also see additional crosses from data feeds and sma

        • Doc - Comission Schemes

        When no line is specified the 1st line of the object will be used.

        It's finally so easy as:

        crossover = bt.ind.CrossOver(line1, line2)
        
        1 Reply Last reply Reply Quote 0
        • B
          backtrader administrators last edited by

          See also this new sample - Blog - Plotting Date Ranges

          1 Reply Last reply Reply Quote 0
          • G
            GwadaMan last edited by

            Great it's working fine !
            Thx !

            1 Reply Last reply Reply Quote 0
            • G
              GwadaMan last edited by

              How can I generated Stochastic signal from other line like "ema of (data)" in Backtrader ?

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

                See the front page: https://www.backtrader.com

                1 Reply Last reply Reply Quote 0
                • C
                  cmmp last edited by

                  Sorry to bring up an old thread, but it would be nice if in the documentation https://www.backtrader.com/docu/indautoref.html , the parameters of bt.ind.CrossOver were defined. There is no params field, so I was not sure if it could be used along with other indicators.

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

                    CrossOver has no parameters. It takes data feeds which will generate a 1, 0 or -1 depending if there is a cross-over to the upside, nothing or a cross-over to the downside.

                    From the documentation:

                    This indicator gives a signal if the provided datas (2) cross up or down
                    
                      - 1.0 if the 1st data crosses the 2nd data upwards
                      - -1.0 if the 1st data crosses the 2nd data downwards
                    
                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors