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/

    Bearish and bullish candles?

    General Code/Help
    2
    6
    825
    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.
    • S
      siavash last edited by

      I am planing to program an indicator needing to determine the candle status(bearish or bullish). how can I code this?

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

        As you may understand, the definition of bearish and bullish may be clear to you, but may not be so obvious for some other people.

        For example:

        • Is it bullish because the high of the day is higher than the high of previous day?

        There are many more variants ... but for example for that case you would compare: self.data.high[0] against self.data.high[-1]

        S 1 Reply Last reply Reply Quote 0
        • S
          siavash @backtrader last edited by

          @backtrader
          I mean that the candle is increasing is bullish ( its open is lower than its close).

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

            self.data.open < self.data.close?

            S 1 Reply Last reply Reply Quote 0
            • S
              siavash @backtrader last edited by

              @backtrader
              Thanks for your help.
              Is there any indicator that I can use to code my indicator regarding bearish and bullish candle as i explained above?

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

                There is no indicator, you have to code the comparison of the points you want as pointed out above

                @backtrader said in Bearish and bullish candles?:

                self.data.open < self.data.close

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