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/

    pivotHigh

    General Code/Help
    1
    1
    46
    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.
    • Gurkan Haznedaroğlu
      Gurkan Haznedaroğlu last edited by

      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])
      
      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
      $(document).ready(function () { app.coldLoad(); }); }