# AdTurtle: An Advanced Turtle Trading System

^{*}

## Abstract

**:**

## 1. Introduction

- * Sliding: the stop loss barrier slides in the same direction as the price moves to more profitable levels.
- * Variable: the width of the stop loss zone adjusts using the latest ATR value.

## 2. Materials and Methods

#### 2.1. Related Work and Background

#### 2.2. Automated Trading Strategy Development

#### 2.2.1. The Donchian Channels

#### 2.2.2. The Average True Range Indicator

#### 2.2.3. The Turtle Trading Strategy

- (i)
- a close short position high line
- (ii)
- an open long position high line
- (iii)
- a close short position high line with extended period and
- (iv)
- an open long position high line with extended period

- (v)
- a close long position low line
- (vi)
- an open short position low line
- (vii)
- a close long position low line with extended period and
- (viii)
- an open short position low line with extended period.

- a period x for opening new positions, used by lines (ii) and (vi)
- a period x/n for closing new positions, used by lines (i) and (v)
- an extended period y for opening positions, used by lines (iv) and (viii)
- an extended period y/m for closing positions, used by lines (iii) and (vii)

#### 2.2.4. The Turtle Expert Advisor Combined with the ATR Indicator for the Stop Loss Strategy

#### 2.3. Data and Implementation

## 3. Results and Discussion

#### 3.1. Default/Selected Parameters

#### 3.2. Sliding and Variable ATR Zone

## 4. Exceptions

## 5. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Appendix A

OnTick() { if(currentPosition == None) { if(previousPosition == None) { if(price > open_high_line)) openLongPosition(); else if(price < open_low_line)) openShortPosition(); } else if(StopLossTriggered == true) { if(price < high_Exclusion_Barrier && price > low_Exclusion_Barrier) return; } else if(previousPosition == Long) { if(lastProfit <= 0 || StopLossTriggered == true) { if(price > open_high_line) openLongPosition(); else if(price < open_low_line)) openShortPosition(); } else { if(price > open_extended_period_high_line) openLongPosition(); else if(price < open_low_line) openShortPosition(); } } else if(previousPosition == Short) { if(lastProfit <= 0 || StopLossTriggered == true) { if(price > open_high_line) openLongPosition(); else if(price < open_low_line)) openShortPosition(); } else { if(price > open_high_line) openLongPosition(); else if(price < open_extended_period_low_line) openShortPosition(); } } } //continues in next section … else if(currentPosition == Long) { if(previousPosition == Long && lastProfit > 0 && StoplossTriggered == false) { if(price < close_extended_period_low_line) closeLongPosition(); } else { if(price < close_low_line) closeLongPosition(); } } else if(currentPosition == Short) { if(previousPosition == Short && lastProfit > 0 && StoplossTriggered == false) { if(price > close_extended_period_high_line) closeShortPosition(); } else { if(price > close_high_line) closeShortPosition(); } } }

OnTick() { if(position_opened_for_the_first_time) { N_ATR = ATR(N); if(currentPosition == Long) { StopLossLine = openPrice – X*N_ATR; NewPositionLine = openPrice + Z*N_ATR; } else { StopLossLine = openPrice + X*N_ATR; NewPositionLine = openPrice - Z*N_ATR; } basePrice = baseOpenPrice = openPrice; openPositions = 1; } }

OnTick() { if(positionIsOpened) { N_ATR = ATR(N); if(currentPosition == Long) { StopLossLine = basePrice – X*N_ATR; newPositionLine = baseOpenPrice + Z*N_ATR; if(currentPrice <= StopLossLine) { StopLossTriggered = true; N_ATR = ATR(N); CloseLongPositions(); return; } if(currentPrice >= newPositionLine) { basePrice = currentPrice; baseOpenPrice = currentPrice; if(openPositions < 5) { OpenLongPosition(); openPosition += 1; } } } // continues in next section … else{ StopLossLine = basePrice + X*N_ATR; newPositionLine = baseOpenPrice - Z*N_ATR; if(currentPrice >= StopLossLine) { StopLossTriggered = true; N_ATR = ATR(N); CloseShortPositions(); return; } if(currentPrice <= newPositionLine) { basePrice = currentPrice; baseOpenPrice = currentPrice; if(openPositions < 5) { OpenLongPosition(); openPosition += 1; } } } } if(noPositionIsOpened) { if(StopLossTriggered == true) { high_Exclusion_Barrier = closingPrice + Y*N_ATR; low_Exclusion_Barrier = closingPrice – Y*N_ATR; } } }

## Appendix B

**Figure A1.**Net profits of AUDUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A2.**Drawdowns of AUDUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A3.**Net profits of EURUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A4.**Drawdowns of EURUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A5.**Net profits of GBPUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A6.**Drawdowns of GBPUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A7.**Net profits of USDCHF between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A8.**Drawdowns of USDCHF as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A9.**Net profits of USDJPY between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A10.**Drawdowns of USDJPY as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A11.**Net profits of XAUUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A12.**Drawdowns of XAUUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A13.**Net profits of OIL between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A14.**Drawdowns of OIL as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A15.**Net profits of BTCUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A16.**Drawdowns of BTCUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure A17.**Net profits of AUDUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A18.**Drawdowns of AUDUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A19.**Net profits of EURUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A20.**Drawdowns of EURUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A21.**Net profits of GBPUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A22.**Drawdowns of GBPUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A23.**Net profits of USDCHF between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A24.**Drawdowns of USDCHF as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A25.**Net profits of USDJPY between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A26.**Drawdowns of USDJPY as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A27.**Net profits of XAUUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A28.**Drawdowns of XAUUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A29.**Net profits of OIL between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A30.**Drawdowns of OIL as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A31.**Net profits of BTCUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A32.**Drawdowns of BTCUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure A33.**Net profits of AUDUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A34.**Drawdowns of AUDUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A35.**Net profits of EURUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A36.**Drawdowns of EURUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A37.**Net profits of GBPUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A38.**Drawdowns of GBPUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A39.**Net profits of USDCHF between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A40.**Drawdowns of USDCHF as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A41.**Net profits of USDJPY between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A42.**Drawdowns of USDJPY as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A43.**Net profits of XAUUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A44.**Drawdowns of XAUUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A45.**Net profits of OIL between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A46.**Drawdowns of OIL as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A47.**Net profits of BTCUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A48.**Drawdowns of BTCUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure A49.**Net profits of BTCUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A50.**Drawdowns of BTCUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A51.**Net profits of EURUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A52.**Drawdowns of EURUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A53.**Net profits of GBPUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A54.**Drawdowns of GBPUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A55.**Net profits of USDCHF between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A56.**Drawdowns of USDCHF as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A57.**Net profits of USDJPY between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A58.**Drawdowns of USDJPY as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A59.**Net profits of XAUUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A60.**Drawdowns of XAUUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A61.**Net profits of OIL between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A62.**Drawdowns of OIL as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A63.**Net profits of BTCUSD between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure A64.**Drawdowns of BTCUSD as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

## References

- Beyoglu, Belin, and Martin Petrov Ivanov. 2008. Technical Analysis of CAN SLIM Stocks. Major Qualifying Project Report. Worcester: Worcester Polytechnic Institute. [Google Scholar]
- Cekirdekci, Mehmet Emre, and Veselin Iliev. 2010. Trading System Development: Trading the Opening Range Breakouts. Interactive Qualifying Project Report. Worcester: Worcester Polytechnic Institute. [Google Scholar]
- Chandrinos, Spyros K., and Nikos D. Lagaros. 2018. Construction of currency portfolios by means of an optimized investment strategy. Operations Research Perspectives 5: 32–44. [Google Scholar] [CrossRef]
- Curtis, Faith. 2007. Way of the Turtle: The Secret Methods that Turned Ordinary People into Legendary Traders. New York City: McGraw-Hill. [Google Scholar]
- Fletcher, Tristan, Zakria Hussain, and John Shawe-Taylor. 2010. Currency Forecasting using Multiple Kernel Learning with Financially Motivated Features. Paper Presented at NIPS 2010 Workshop: New Directions in Multiple Kernel Learning, Whistler, BC, Canada, December 11. [Google Scholar]
- Ghosh, Ritesh, and Priyanka Purkayastha. 2017. Forecasting Profitability in Equity Trades using Random Forest, Support Vector machine and xgboost. Paper Presented at 10th International Conference on Recent Trends in Engineering Science and Management, Andhra Pradesh, India, August 12; ISBN 978-93-86171-56-6. [Google Scholar]
- Gilligan, Nicholas James. 2009. Exit Strategy Analysis with CAN SLIM Stocks. Interactive Qualifying Project Report. Worcester: Worcester Polytechnic Institute. [Google Scholar]
- Jackson, Wong Tzu Seong. 2006. An Empirical Investigation of Technical Analysis in Fixed Income Markets. Durham thesis, Durham University, Durham. Available online: http://etheses.dur.ac.uk/2683/ (accessed on 10 September 2018).
- Levene, Joshua, Justin Marcotte, and Joshua Nottage. 2014. Stock Trading Systems: Analysis and Development of a System of Systems. Interactive Qualifying Project Report. Worcester: Worcester Polytechnic Institute. [Google Scholar]
- Swart, Justin-Niall. 2016. Testing a Price Breakout Strategy Using Donchian Channels. Doctoral dissertation, University of Cape Town, Cape Town, South Africa. [Google Scholar]
- Vanstone, Bruce J., and Gavin R. Finnie. 2006. Combining Technical Analysis and Neural Networks in the Australian Stockmarket. August. Available online: http://epublications.bond.edu.au/infotech_pubs/16 (accessed on 12 September 2018).
- Vezeris, Dimitrios Th., and Christos J. Schinas. 2018. Performance Comparison of Three Automated Trading Systems (MACD, PIVOT and SMA) by Means of the d-Backtest PS Implementation. International Journal of Trade, Economics and Finance 9: 170–73. [Google Scholar] [CrossRef]
- Vezeris, Dimitrios Th, Christos J Schinas, and Garyfalos Papaschinopoulos. 2016. Profitability Edge by Dynamic Back Testing Optimal Period Selection for Technical Parameters Optimization, in Trading Systems with Forecasting. Computational Economics 51: 761–807. [Google Scholar] [CrossRef]
- Vezeris, Dimitrios Th, Themistoklis S. Kyrgos, and Christos J. Schinas. 2018a. Hedging and non-hedging trading strategies on commodities using the d-Backtest PS method. Investment Management and Financial Innovations 15: 351–69. [Google Scholar] [CrossRef]
- Vezeris, Dimitrios, Themistoklis Kyrgos, and Christos Schinas. 2018b. Take Profit and Stop Loss Trading Strategies Comparison in Combination with an MACD Trading System. Journal of Risk and Financial Management 11: 56. [Google Scholar] [CrossRef]
- Wilcox, Cole, and Eric Crittenden. 2005. Does Trend Following Work on Stocks? Phoenix: Blackstar Funds, LLC. [Google Scholar]

**Figure 2.**The lines used by the Turtle indicator as described above, on a EURUSD chart with x = 24, y = 60 and n = m = 2.

**Figure 3.**The Turtle basic strategy, showing when a position is opened or closed based on the open high or low lines as described in the sections above.

**Figure 4.**Initialization process after opening the first position. N_ATR is the ATR value at the time the position is opened, X is a constant adjusting the width of the stop loss zone and Z is a constant adjusting the width of the new position zone at which the trading strategy adds to the initial position.

**Figure 5.**Recalculation and checking point of the stop loss and open new position barriers in order to close or open a position if needed.

**Figure 6.**Creating the exclusion zone after a stop loss was triggered and preventing the opening of a new position until the price level escapes the upper or lower exclusion barrier.

**Figure 9.**Averages of profits between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure 10.**Averages of drawdowns as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the fast parameters (20, 40).

**Figure 11.**Averages of profits between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure 12.**Averages of drawdowns as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the medium parameters (40, 80).

**Figure 13.**Averages of profits between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure 14.**Averages of drawdowns as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160).

**Figure 15.**Averages of profits between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

**Figure 16.**Averages of drawdowns as percentage of equity between the classic and the advanced Turtle systems for every combination of N, X, Y for the slow parameters (80, 160), where X ≥ 5.

Period | x | y |
---|---|---|

Fast | 20 | 40 |

Medium | 40 | 80 |

Slow | 80 | 160 |

**Table 2.**Classic Turtle’s gross profits, gross losses and net profits for experiments (a), (b), (c) and (d).

(a) Default Parameters (24, 60) | (b) Fast Parameters (20, 40) | |||||

Net Profit | Gross Profit | Gross Loss | Net Profit | Gross Profit | Gross Loss | |

AUDUSD | −9636.01 | 16,914.7 | −26,550.7 | −9674.94 | 15,818.43 | −25,493.4 |

EURUSD | −8087.32 | 12,017.26 | −20,104.6 | −7832.53 | 13,364.93 | −21,197.5 |

GBPUSD | −7898.31 | 39,862.89 | −47,761.2 | −7836.9 | 47,196.86 | −55,033.8 |

USDCHF | −9081.14 | 12,108.09 | −21,189.2 | −9752.17 | 8478.36 | −18,230.5 |

USDJPY | −8827.44 | 13,201.94 | −22,029.4 | −9010.45 | 18,294.17 | −27,304.6 |

XAUUSD | −9161.71 | 8763.07 | −17,924.8 | −9286.01 | 7455.89 | −16,741.9 |

OIL | −8153.81 | 75,642.93 | −83,796.7 | −9276.26 | 33,808.78 | −43,085 |

BTCUSD | −1267.01 | 1474.76 | −2741.77 | −1205.69 | 1717.41 | −2923.10 |

(c) Medium Parameters (40, 80) | (d) Slow Parameters (80, 160) | |||||

Net Profit | Gross Profit | Gross Loss | Net Profit | Gross Profit | Gross Loss | |

AUDUSD | −9297.96 | 13,484.47 | −22,782.4 | −8434.49 | 11,016.81 | −19,451.3 |

EURUSD | −3794.34 | 21,024.66 | −24,819 | 13,971.05 | 43,305.2 | −29,334.2 |

GBPUSD | −5431.3 | 38,974.89 | −44,406.2 | −2756.01 | 32,226.36 | −34,982.4 |

USDCHF | −8597.67 | 13,870.83 | −22,468.5 | −7190.73 | 11,746.55 | −18,937.3 |

USDJPY | −8801 | 8942.25 | −17,743.3 | −8682.88 | 4479.6 | −13,162.5 |

XAUUSD | −8954.82 | 4888.77 | −13,843.6 | −8234.85 | 4186.42 | −12,421.3 |

OIL | −6531.24 | 63,501.81 | −70,033.1 | −3192.86 | 32,739.15 | −35,932 |

BTCUSD | −950.56 | 1293.62 | −2244.18 | −937.85 | 948.26 | −1886.11 |

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Vezeris, D.; Karkanis, I.; Kyrgos, T.
AdTurtle: An Advanced Turtle Trading System. *J. Risk Financial Manag.* **2019**, *12*, 96.
https://doi.org/10.3390/jrfm12020096

**AMA Style**

Vezeris D, Karkanis I, Kyrgos T.
AdTurtle: An Advanced Turtle Trading System. *Journal of Risk and Financial Management*. 2019; 12(2):96.
https://doi.org/10.3390/jrfm12020096

**Chicago/Turabian Style**

Vezeris, Dimitrios, Ioannis Karkanis, and Themistoklis Kyrgos.
2019. "AdTurtle: An Advanced Turtle Trading System" *Journal of Risk and Financial Management* 12, no. 2: 96.
https://doi.org/10.3390/jrfm12020096