Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. freedumb2000
    3. Posts
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    F
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by freedumb2000

    • RE: Pass ZeroLag indicator output as input to RSI

      I made a mistake in the post above, but I cannot find a way to edit the post? Please let me know how to edit the post above or delete it. Thank you

      posted in General Discussion
      F
      freedumb2000
    • RE: Pass ZeroLag indicator output as input to RSI

      You need to always the "lines" class attribute, when creating an indicator, if if you don't use any lines. Also, you never actually passed the output of ZeroLag to RSI.
      This works:

      class MyIndicator(bt.Indicator):
          lines = ("dummyline",)
      
          def __init__(self):
              self.zerolag = bt.indicators.ZeroLagIndicator(self.data, period=5)
              self.rsi = bt.indicators.RSI(self.zerolag, period=5)
      
          def next(self):
              print("zerolag[0]=" + str(self.zerolag[0]))
              print("rsi[0]=" + str(self.rsi[0]))
      

      This is actually useful:

      class MyIndicator(bt.Indicator):
          lines = ("zerolag", "rsi")
      
          def __init__(self):
              self.zerolag = bt.indicators.ZeroLagIndicator(self.data, period=5)
              self.rsi = bt.indicators.RSI(self.zerolag, period=5)
      
      posted in General Discussion
      F
      freedumb2000
    • RE: Plotting: how to get lines to have specific colours and thickness?

      Another, maybe clearer, option is:

      ichimoku = bt.indicators.Ichimoku()
      ichimoku.plotlines.senkou_span_b.color = "yellow"
      [...]
      
      posted in General Code/Help
      F
      freedumb2000
    • 1 / 1