For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Problem with custom Indicator

  • Hi guys,

    I'm trying to implement a indicator:

    class IFT(bt.Indicator):
      lines = ('ift',)
      plotlines = dict(ift=dict(color='black', ls='-', linewidth=1.5))
      def init(self):
         v = 0.1 *
         self.l.ift = 100 * (np.exp(v) - 1) / (np.exp(v) + 1)
    class testStrategy(bt.Strategy):
      self.IFT = IFT(

    TypeError: 'numpy.ndarray' object is not callable

    Help will be appreciated.


  • np.exp requires array as an argument and v is not an array.

  • Hi ab_trader,

    many thanks for the answer
    can you tell me how i convert into array?


Log in to reply