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

pivotHigh



  • Hi, I am new both at finance and python. I wonder is there any built in function like pine script pivotHigh(rb,lb). I try to create my own but I stuck with getting Highest and lowest values . any example will be appriciated. thanks.

    def __init__(self):
           lines = ('pivots',)
           self.o=self.datas[0].open
           self.h=self.datas[0].high
           self.l=self.datas[0].low
           self.c=self.datas[0].close
           self.datas[0].pivots= (self.h + self.l + self.c) / 3.00
          
        
           
       def next(self):
           mmax=  bt.ind.Highest(self.datas[0].pivots.get(size=5))     
           print(mmax[0])
    

Log in to reply
 

});