OPEN-SOURCE SCRIPT
Turtle Trading System (Not Financial Advise)

I am testing this script, not financial advise, but this is how it works, i hope;
How the Script Works
The script is a TradingView strategy that backtests and automates the Turtle rules. It uses two systems, a short-term S1 (20-day) and a long-term S2 (55-day), which you can select to test.
The strategy follows these core principles:
Trend Identification: The script uses Donchian Channels to identify breakouts. A new trend is signaled when the price breaks above the highest high or below the lowest low of a specified period.
Position Sizing: The script automatically calculates the size of each trade unit to ensure you risk a consistent percentage of your capital on every trade. This is based on the Average True Range (ATR), which measures volatility.
Pyramiding: When a trade moves in a profitable direction, the script will add more units at specific intervals to increase your position and ride the trend. This is how the Turtles made their big profits.
Win/Loss Condition:
A crucial rule is implemented for System 1 (S1): you only enter a trade if the previous S1 trade was a loss. If the last S1 trade was a win, you must wait for a signal from System 2 (S2).
How to Enter and Exit a Long Position
The script will automatically enter a long position when the price breaks above the highest high of the last 20 days (S1) or 55 days (S2), depending on which system you've selected.
Stop-Loss (SL): Your stop-loss is automatically placed at a distance of 2 * N (ATR) below the entry price. . This is a crucial risk management rule that limits your potential loss. The stop-loss is also plotted visually on the chart.
Exit Long: The script will close the long position automatically under two conditions:
Reversal: The price drops and closes below the lowest low of the last 10 days (S1) or 20 days (S2).
Stop-Loss Hit: The price hits your initial stop-loss, limiting your loss.
How to Enter and Exit a Short Position
Enter Short: The script will automatically enter a short position when the price breaks below the lowest low of the last 20 days (S1) or 55 days (S2).
Stop-Loss (SL): Your stop-loss is automatically placed at a distance of 2 * N (ATR) above the entry price. . This prevents large losses if the price moves against you.
Exit Short: The script will close the short position automatically under two conditions:
Reversal: The price rallies and closes above the highest high of the last 10 days (S1) or 20 days (S2).
Stop-Loss Hit: The price hits your initial stop-loss, limiting your loss.
How the Script Works
The script is a TradingView strategy that backtests and automates the Turtle rules. It uses two systems, a short-term S1 (20-day) and a long-term S2 (55-day), which you can select to test.
The strategy follows these core principles:
Trend Identification: The script uses Donchian Channels to identify breakouts. A new trend is signaled when the price breaks above the highest high or below the lowest low of a specified period.
Position Sizing: The script automatically calculates the size of each trade unit to ensure you risk a consistent percentage of your capital on every trade. This is based on the Average True Range (ATR), which measures volatility.
Pyramiding: When a trade moves in a profitable direction, the script will add more units at specific intervals to increase your position and ride the trend. This is how the Turtles made their big profits.
Win/Loss Condition:
A crucial rule is implemented for System 1 (S1): you only enter a trade if the previous S1 trade was a loss. If the last S1 trade was a win, you must wait for a signal from System 2 (S2).
How to Enter and Exit a Long Position
The script will automatically enter a long position when the price breaks above the highest high of the last 20 days (S1) or 55 days (S2), depending on which system you've selected.
Stop-Loss (SL): Your stop-loss is automatically placed at a distance of 2 * N (ATR) below the entry price. . This is a crucial risk management rule that limits your potential loss. The stop-loss is also plotted visually on the chart.
Exit Long: The script will close the long position automatically under two conditions:
Reversal: The price drops and closes below the lowest low of the last 10 days (S1) or 20 days (S2).
Stop-Loss Hit: The price hits your initial stop-loss, limiting your loss.
How to Enter and Exit a Short Position
Enter Short: The script will automatically enter a short position when the price breaks below the lowest low of the last 20 days (S1) or 55 days (S2).
Stop-Loss (SL): Your stop-loss is automatically placed at a distance of 2 * N (ATR) above the entry price. . This prevents large losses if the price moves against you.
Exit Short: The script will close the short position automatically under two conditions:
Reversal: The price rallies and closes above the highest high of the last 10 days (S1) or 20 days (S2).
Stop-Loss Hit: The price hits your initial stop-loss, limiting your loss.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。