Skip to content

Introduction

This section hosts a collection of Indicator implementations which are not part of the backtrader core.

To use them:

  • Copy the code to a file of your choice or directly above your strategy
  • If copied to a file, import it from the file

    from myfile import TheIndicator
    
  • And use it in your strategy

    class MyStrategy(bt.Strategy):
        def __init__(self):
            self.myind = TheIndicator(self.data, param1=value1, ...)