Turtle Trading System 0

Posted on 4, February 2014

in Category SID


Description for TurtleTrader SID 739

The Turtle Trading system is arguably the most famous of all trading systems. Defined by Richard Dennis and Bill Eckhardt and taught to a group of traders called the Turtles it has become a classic as trading story as it encompasses the actual trading rules but also the psychology and discipline needed to trade the system.

Much has been written about the Turtle Trading system and it has spawned a whole set of similar systems, but it’s still an interesting exercise to understand how the turtle trading system performs against modern datasets and instruments. The system below is an interpretation of the Original Turtle Trading Rules and trades Forex at the hour time frame and has a positive results when backtested over a 1 year time period.

Turtle Trading System/sid Notes for this Trading Account:

Turtle Trader
==========

– Trades on a hourly timeframe.
– Enter conditions are based upon the last 20 bars from the previous day.
– Exit conditions are based upon the last 10 bars from the previous day.

TTFallback
=========

– Trades on a half hourly timeframe.
– Enter conditions are based upon the last 55 bars from the previous day.
– Exit conditions are based upon the last 20 bars from the previous day.

Turtle Trading System/sid Rules for this Trading Account:

Turtle Trading System/sid Notes for this Trading System:

Turtle Trading System/sid Rules for this Trading System:

Turtle Trading System/sid Bar event logic:

#This is the main strategy used by the Turtle Traders. The conditions are based upon the highest high and the lowest low within a 20 day period and if the closing price breaks through those points a trade is executed.
#However, in our case, we are using the last 20 bars from the previous day.

#Checking trade history in order to retrieve the last trade.
my $trade = TradeHistory(1);
if($trade){
	$trade = $trade->NetProfit;
}

#System 1 opening rules.

#If the closing price is greater than highest high within the 20 bars from the previous day and there isn't a short position in place but the last trade is a winning trade then skip this trade.
#If all the above is true apart from the last trade wasn't a winning trade then intiate a long position.
if(ClosePrice>Yesterday(Highest(High,$Enter)) && $trade && $trade>0 && $skip==0 && ShortPosition==undef){
	$skip = 1;
}elsif(ClosePrice>Yesterday(Highest(High,$Enter)) && ShortPosition==undef){
	BuyOpen;
	$skip = 0;
}

#If the closing price is lower than lowest low within the 20 bars from the preivous day and there isn't a long position in place but the last trade is a winning trade then skip this trade.
#If all the above is true apart from the last trade wasn't a winning trade then intiate a short position.
if(ClosePrice<Yesterday(Lowest(Low,$Enter)) && $trade && $trade>0 && $skip==0 && LongPosition==undef){
	$skip = 1;
}elsif(ClosePrice<Yesterday(Lowest(Low,$Enter)) && LongPosition==undef){
	SellOpen;
	$skip = 0;
}

#System 1 exiting rules.

#Trailing stop loss based upon Richard Dennis's stop loss forumla.
PlaceStopLoss('Stoploss',ClosePrice-2*Now(ATR(20)));

#If there is a long position and the close price is lower than the lowest low within the 10 bars of the previous day then close the position.
PlaceSellOpen('CloseBuy') if ClosePrice<Yesterday(Lowest(Low,$Exit)) && LongPosition;
#If there is a short position and the close price is higher than the highest high within the 10 bars of the previous day then close the position.
PlaceBuyOpen('CloseSell') if ClosePrice>Yesterday(Highest(High,$Exit)) && ShortPosition;

Turtle Trading System/sid Notes for this Trading System:

Turtle Trading System/sid Rules for this Trading System:

Turtle Trading System/sid Bar event logic:

#This is the fallback system that Richard Dennis introduced to his Turtle Traders.
#The concept was that there could be a moment where the Turtle Trader system misses a vital trade therefore the following system is put in place to ideally take these big breakouts.

#The original system used the highest high and lowest low within the last 55 days.
#This system uses the last 55 bars from the previous day and uses the highest high and lowest low from the last 55 bars.

#If there is no positions in the whole account...
if(AccNoPosition){
	#System 2 opening rules.
	#If the close price is greater than the highest high within the last 55 bars from the previous day then enter a long position.
	BuyOpen if ClosePrice>Yesterday(Highest(High,$Enter));
	#If the close price is lower than the lowest low within the last 55 bars from the previous day then enter a short position.
	SellOpen if ClosePrice<Yesterday(Lowest(Low,$Enter));
}else{
	#System 2 exiting rules.
	#If the close price is lower than the lowest low within the last 20 bars from the previous day and there is a long position then close the position.
	PlaceSellOpen('CloseBuy') if ClosePrice<Yesterday(Lowest(Low,$Exit)) && LongPosition;
	#If the close price is higher than the highest high within the last 20 bars from the previous day and there is a short position then close the position.
	PlaceBuyOpen('CloseBuy') if ClosePrice>Yesterday(Highest(High,$Exit)) && ShortPosition;
}

#Trailing stop loss based upon Richard Dennis's stop loss forumla.
PlaceStopLoss('Stoploss',ClosePrice-2*Now(ATR(55)));

0 Comments

Leave a Message