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.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.