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/

    Williams Alligator

    Indicators/Strategies/Analyzers
    2
    3
    922
    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.
    • L
      Lucas Condé last edited by Lucas Condé

      Hi, is there a way to implement indicator such as Williams Alligator in BackTrader?

      These would be the rules, but since it states that it needs to be moved into the future I think I need to use future bars (self.lines.lips[3] for example)

      I managed to code some of it, but when I use the future bars I get an exception. I might just be getting the wrong understanding on the logic of the indicator aswell.

      1. The Alligator’s Jaw, the “Blue” line, is a 13-period Smoothed Moving Average, moved into the future by 8 bars;

      2. The Alligator’s Teeth, the “Red” line, is an 8-period Smoothed Moving Average, moved by 5 bars into the future;

      3. The Alligator’s Lips, the “Green” line, is a 5-period Smoothed Moving Average, moved by 3 bars into the future.

      B 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators @Lucas Condé last edited by

        You cannot put things into the future. But you can bring things from the past into the present.

        See the implementation of the Ichimoku Cloud which also needs to put things into the future.

        • https://github.com/backtrader/backtrader/blob/master/backtrader/indicators/ichimoku.py
        L 1 Reply Last reply Reply Quote 0
        • L
          Lucas Condé @backtrader last edited by

          @backtrader Thank you, I will take a look.

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