adrian.tan.7568596

Active trader turtles strategy modified

176
Enter when price break 55 days high and exit when price break 20 days low
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@version=2
//coded by tmr0
//original idea from «Way of the Turtle: The Secret Methods that Turned Ordinary People into Legendary Traders» (2007) CURTIS FAITH
strategy("Turtles strategy modified", shorttitle = "Turtles", overlay=true, pyramiding=5, default_qty_type= strategy.cash, default_qty_value = 1000)

enter = input(55, minval=1)
exit = input(20, minval=1)
year_from = input(2009, minval=2000)
year_before = input(2014, minval=2000)

slowL = highest(enter)
slowLC = lowest(exit)

enterL = high > slowL[1]
exitL = low <= slowLC[1]

strategy.entry("slow L", strategy.long, when = enterL and year>=year_from and year<year_before)
strategy.close("slow L", when = exitL and year>=year_from and year <year_before)