Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Philip Ollas5,705 Points
Getting indicator code to work on Python
How would I get this one to run on Python 3.6?? I'm stuck and I can't figure it out how make it work on Python. Please help me out guys.
import matplotlib.pyplot as plot import matplotlib def pivotFunc("Pivot Reversal Strategy", overlay=true) leftBars = input(4) rightBars = input(2) swh = pivothigh(leftBars, rightBars) swl = pivotlow(leftBars, rightBars) swh_cond = not na(swh) hprice = swh_cond ? swh : hprice le = swh_cond ? true : (le and high > hprice ? false : le) if (le) strategy.entry("PivRevLE", strategy.long, comment="PivRevLE", stop=hprice + syminfo.mintick) swl_cond = not na(swl) lprice = swl_cond ? swl : lprice se = swl_cond ? true : (se and low < lprice ? false : se) if (se) strategy.entry("PivRevSE", strategy.short, comment="PivRevSE", stop=lprice - syminfo.mintick)