ProRealTime
Un Forum pour discuter des méthodes de trading que nous utilisons, de nos recherches...

Turtles trading

par plataxis » 13 déc. 2015 22:27

Bonjour,

Je me demandais si quelqu'un avait eu la curiosité de backtester le système des "turtles" récemment ? Logiquement ça devrait marcher, Livermoore disait "wall street ne changera jamais", même si les marchés modernes électroniques ont quelque-peu mutés...

Bref je lance l'idée avec quelques éléments de rappels sur leur stratégie :
- certains marchés uniquement (note : pas les indices :) )
- taille selon la volatilité (N = atr 20 avant même sa consécration)
- stop à 2% du capital maximummum = 2N (une variante avec stop serré à 1/2 N)
- pyramidage par 1/4 de position tous les 1/2N
- entrée sur breakout du max / min des 20 derniers jours (55 pour du long terme)
- sortie sur retracement au max / min des 10 derniers jours (20 pour du long terme).

Je vais tâcher de coder tout ou partie de ceci sous prt, sauf si une bonne âme l'a déjà fait ça m'intéresse.

Re: Turtles trading

par plataxis » 13 déc. 2015 23:11

1ere ébauche de code non concluante, pyramidage non géré et sans doutes quelques soucis.
Spoiler:

Code : #

// Définition des paramètres du code
DEFPARAM CumulateOrders = False // Cumul des positions désactivé

entree = 20
sortie = 10
breakout = 3

// Stops
niveaustop = AverageTrueRange [20] * 2
SET STOP pLOSS niveaustop

// Conditions pour ouvrir une position acheteuse
long = Highest[entree] (high) + breakout
BUY 2 CONTRACT AT long STOP


// Conditions pour fermer une position acheteuse
nouveaustop = Highest[sortie] (high)
if niveaustop < nouveaustop then
SET STOP pLOSS nouveaustop
endif

// Conditions pour ouvrir une position en vente à découvert
nouveaustop = lowest[sortie] (low)
court = lowest[entree] (low) - breakout
SELLSHORT 2 CONTRACT AT court STOP



Re: Turtles trading

par leroidessables » 14 déc. 2015 00:23

:top: je regarderai avec curiosité ;)

Re: Turtles trading

par plataxis » 15 déc. 2015 11:02

Correction du code : c'est pas encore pyramidé, et loin d'être gagnant, mais c'est plus dans l'esprit de départ :
Spoiler:

Code : #

// Définition des paramètres du code
DEFPARAM CumulateOrders = False // Cumul des positions désactivé

entree = 20
sortie = 10
breakout = 3

// Stops
distancestop = AverageTrueRange [20] * 2
premierstoplong = close - distancestop
premierstopcourt = close + distancestop

// Conditions pour ouvrir une position acheteuse
long = Highest[entree] (high) + breakout
BUY 1 CONTRACT AT long STOP
SET STOP LOSS premierstoplong

// Conditions pour fermer une position acheteuse
if longonmarket then
nouveaustop = Highest[sortie] (high)
if nouveaustop > premierstoplong then
SET STOP LOSS nouveaustop
endif
endif

// Conditions pour ouvrir une position en vente à découvert

court = lowest[entree] (low) - breakout
SELLSHORT 1 CONTRACT AT court STOP
SET STOP LOSS premierstopcourt

if shortonmarket then
nouveaustop = lowest[sortie] (low)
if nouveaustop < premierstopcourt then
SET STOP pLOSS nouveaustop
endif
endif

Re: Turtles trading

par plataxis » 16 déc. 2015 16:13

Bon, clairement un souci avec l'interaction stop initial / stop suiveur. Pas simple...
Spoiler:

Code : #

// Définition des paramètres du code
DEFPARAM CumulateOrders = True // Cumul des positions activé
DEFPARAM PreLoadBars = 20 // charge 20 barres avant de placer le premier ordre

// Définition des paramètres du code
entree = 21
sortie = 11
breakout = .1

// SL initiaux
//distanceSL = AverageTrueRange [20] * 2
//initialSLlong = close - distanceSL
//initialSLcourt = close + distanceSL

if not onmarket then
// Conditions pour ouvrir une position acheteuse
long = Highest[entree] (high) + breakout
BUY 1 CONTRACT AT long STOP

// Conditions pour ouvrir une position en vente à découvert
court = lowest[entree] (low) - breakout
SELLSHORT 1 CONTRACT AT court STOP
endif

// Conditions pour fermer une position acheteuse
nouveauSLlong = lowest[sortie] (low)

// Conditions pour fermer une position en vente à découvert
nouveauSLcourt = highest[sortie] (high)

// Conditions pour fermer une position acheteuse
if longonmarket then
//SET STOP LOSS initialSLlong
nouveauSLlong = Highest[sortie] (high)
//if nouveauSLlong > initialSLlong then
SET STOP LOSS nouveauSLlong
//endif
endif

// Conditions pour fermer une position en vente à découvert
if shortonmarket then
//SET STOP LOSS initialSLcourt
nouveauSLcourt = lowest[sortie] (low)
//if nouveauSLcourt < initialSLcourt then
SET STOP pLOSS nouveauSLcourt
//endif
endif

Re: Turtles trading

par ladefense92800 » 16 déc. 2015 20:19

va voir le systeme de break out pour t inspirer y a un truc comme ça de memoire ....

page 68 dans un des pdf de prt

Re: Turtles trading

par ladefense92800 » 16 déc. 2015 20:24

http://www.trade2win.com/boards/trading-systems/145170-turtle-system-probacktest-prorealtime.html
Hi.

Does anybody have the correct programing code for the Richard Dennis' Turtle System using Prorealtime / Probacktest?

Forgetting the System 1 and Ststem 2 and position sizing fro now, I have been trying to get it to just make the first trade at the breakout point and then add at half an ATR and exit positions at -2xATR or the 10 day lowline. I can't even get this bit to work. My code so far is below but it produces weird results. I'd like to get this working if anyone can help? Also I would like to know if the position sizing the Turtles used is possible on Probacktest i.e. 2% account risk on any trade. The calculation should be (Account*0.02)/(ATR*2) but I don;t know if it's possible to program this into Probacktest. ANY hellp would be much apprieciated!

-------

Code : #

REM defining the donchien channels
SlowHighlineCurr = Highest [20] (high)
SlowLowlineCurr = lowest [20] (low)
FastHighlineCurr = Highest [10] (high)
FastLowlineCurr = lowest [10] (low)
REM adjusting channels so that current bar is not included
SlowHighline = SlowHighlineCurr[1]
SlowLowline = SlowLowlineCurr[1]
FastHighline = FastHighlineCurr[1]
FastLowline = FastLowlineCurr[1]
REM Define ATR
ATR = AverageTrueRange[20]



REM LONG BUYS

IF not onmarket then
BUY 1 shares at SlowHighline Stop
Long = 1
ENDIF

if Long = 1 and high > (entryquote + (ATR*0.5)) then
buy 1 shares at (entryquote + (ATR*0.5)) stop
Long = 2
ELSE
If Long = 2 and high > entryquote + (ATR*0.5) then
buy 1 shares at (entryquote + (ATR*0.5)) stop
Long = 3
ELSE
IF Long = 3 and high > entryquote + (ATR*0.5) then
buy 1 shares at (entryquote + (ATR*0.5)) stop
Long = 4
ENDIF
ENDIF
ENDIF

REM LONG EXITS

IF longonmarket then
Sell at FastLowline stop
SET STOP Entryquote - (ATR*2)
endif

REM SHORT SALES

IF not onmarket then
SELLSHORT 1 shares at SlowLowline stop
Short = 1
ENDIF

IF Short = 1 and low < entryquote - (ATR*0.5) then
Sellshort 1 shares at entryquote - (ATR*0.5) stop
Short = 2
ELSE
If Short = 2 and low < entryquote - (ATR*0.5) then
Sellshort 1 shares at entryquote - (ATR*0.5) stop
Short = 3
ELSE
IF Short = 3 and low < entryquote - (ATR*0.5) then
Sellshort 1 shares at entryquote - (ATR*0.5) stop
Short = 4
ENDIF
ENDIF
ENDIF


REM SHORT EXITS

IF Shortonmarket then
EXitshort at FastHighline Stop
SET STOP Entryquote + (ATR*2)
ENDIF



REM SHORT EXITS

IF Shortonmarket then
EXitshort at FastHighline Stop
SET STOP Entryquote + (ATR*2)
ENDIF

Re: Turtles trading

par ladefense92800 » 16 déc. 2015 20:30

Hier ist der TURTLE indicator

Code : #

EMA3 = ExponentialAverage[3](close)
EMA5 = ExponentialAverage[5](close)
EMA8 = ExponentialAverage[8](close)
EMA10 = ExponentialAverage[10](close)
EMA12 = ExponentialAverage[12](close)
EMA15 = ExponentialAverage[15](close)
EMA30 = ExponentialAverage[30](close)
EMA35 = ExponentialAverage[35](close)
EMA40 = ExponentialAverage[40](close)
EMA45 = ExponentialAverage[45](close)
EMA50 = ExponentialAverage[50](close)
EMA60 = ExponentialAverage[60](close)


RETURN EMA3 COLOURED(0,0,255), EMA5 COLOURED(0,0,255) ,EMA8 COLOURED(0,0,255) , EMA10 COLOURED(0,0,255) ,EMA12 COLOURED(0,0,255) , EMA15 COLOURED(255,0,0) ,EMA30 COLOURED(255,0,0), EMA35 COLOURED(255,0,0),EMA40 COLOURED(255,0,0), EMA45 COLOURED(255,0,0),EMA50 COLOURED(255,0,0), EMA60 COLOURED(255,0,0)


Und hier den BACKTEST
ignored, ignored, ignored, ignored, ignored, ignored, EMA30, EMA35, EMA40, EMA45, EMA50, EMA60= CALL "My Turtle Indicator"
MyRSI = RSI[14](close)


MaxRed = MAX(EMA60,MAX(EMA50,MAX(EMA45,MAX(EMA40,MAX(EMA35, MAX(EMA30,close))))))
MinRed = MIN(EMA60,MIN(EMA50,MIN(EMA45,MIN(EMA40,MIN(EMA35, MIN(EMA30,close))))))

REM Buy
c1 = (Close >= MaxRed)
IF c1 AND myRSI > 0.5 THEN
BUY 100 SHARES AT MARKET NEXTBAROPEN
ENDIF


REM Sell
c2 = (Close <= MinRed)
IF c2 AND myRSI < 0.5 THEN
SELLSHORT 100 SHARES AT MARKET NEXTBAROPEN
ENDIF

Re: Turtles trading

par plataxis » 16 déc. 2015 20:53

Merci Ladefence :)

je ne vois pas très bien l'utilité des EMA compte-tenu de ce que je sais du système turtles. Quant au premier code, je remarque qu'il n'a pas utilisé de stop à l'entrée en position lui non-plus : c'est là où je butte également. Mais ce code pourrait me servir tout de même pour les directives utilisées que je maîtrise mal.

Je remarque aussi que, comme moi, l'auteur de ce code peine à trouver un "price" différent des valeurs OHLC, ce qui est logique compte-tenu du fait que ce sont les seules infos stockées en historique. D'où la nécessité de travailler avec des stops.

Re: Turtles trading

par ladefense92800 » 16 déc. 2015 21:07

http://www.aktienboard.com/forum/f29/prorealtime-cmc-script-programmierung-t94783/170
En cas de galere , demande à falex il super competent/doué , sinon le formulaire de prt ( ..... ça marche bien .... ;) )

et tiens nous au courant .

Re: Turtles trading

par plataxis » 17 déc. 2015 09:25

Merci Ladefense,

Visiblement les allemands cités n'ont pas la même version que moi du système des "turtles".

Falex a sûrement vu passer la file et probablement mieux à faire que de dépoussiérer une méthode de trading du siècle dernier.

Pour ma part nouvel essai infructueux et un peu de lassitude aussi : je réessaierai peut-être plus tard...
Spoiler:

Code : #

REM defining the donchien channels
SlowHighlineCurr = Highest [20] (high)
SlowLowlineCurr = lowest [20] (low)
//FastHighlineCurr = Highest [10] (high)
FastLowlineCurr = lowest [10] (low)
REM adjusting channels so that current bar is not included
SlowHighline = SlowHighlineCurr[1]
SlowLowline = SlowLowlineCurr[1]
medline = SlowLowline + ((SlowHighline - SlowLowline) / 2)
//FastHighline = FastHighlineCurr[1]
FastLowline = FastLowlineCurr[1]
REM Define ATR
ATR = AverageTrueRange[20]
REM min breakout to enter
breakmin = 0.1
entrylong1 = (SlowHighline + breakmin)
entrylong2 = entrylong1 + (ATR/2)
entrylong3 = entrylong1 + ATR
entrylong4 = entrylong1 + (3*ATR/2)

REM LONG BUYS

IF not onmarket AND high > medline  then
BUY 1 shares at entrylong1 Stop
BUY 1 shares at entrylong2 Stop
BUY 1 shares at entrylong3 Stop
BUY 1 shares at entrylong4 Stop
ENDIF

REM long stops
IF longonmarket then
SL1 = entrylong1 - (2*ATR)
SL2 = entrylong2 - (2*ATR)
SL3 = entrylong3 - (2*ATR)
SL4 = entrylong4 - (2*ATR)
ENDIF


IF COUNTOFLONGSHARES = 1 then
SET STOP LOSS SL1
ENDIF
IF COUNTOFLONGSHARES = 2 then
SET STOP LOSS SL2
ENDIF
IF COUNTOFLONGSHARES = 3 then
SET STOP LOSS SL3
ENDIF
IF COUNTOFLONGSHARES = 4 then
SET STOP LOSS SL4
ENDIF

REM LONG EXITS
IF longonmarket then
Sell at FastLowline stop
endif

Re: Turtles trading

par falex » 17 déc. 2015 10:27

LOL, heu dis donc plataxis c'est quoi ce jugement de valeur ...

Oh oui encore encore ladefense, j'aime quand tu me brosses dans les sens du(des) poil(s) :oops:

Tu veux que je te publie ma version des turtles, programmé en 2013, c'est ça ?

---

A l'époque j'étais partie du PDF que tout le monde a vue et relue. Au final je l'avais trouvé beaucoup trop "imprecis" quand aux conditions d'entrée et de validation entre les deux MM et atr.

Dis autrement, les pdf dispo sur le net sont comme certains texte religions : Avec une grosse pars d'interpretation ...
Et c'est là que ça me dérange.

Je vais regarder où je me m'étais arrêté.

Re: Turtles trading

par plataxis » 17 déc. 2015 10:31

C'était ma façon maladroite de dire que je ne te solliciterai pas pour si peu. Si tu veux m'aider, je suis persuadé que tu le peux, mais, tu fais déjà beaucoup, rien ne t'y oblige et je ne sais pas demander. Mais si tu as un code en stock, j'apprécierai vraiment d'avoir le privilège de le contempler de près.

Re: Turtles trading

par falex » 17 déc. 2015 10:32

Ah si attends je me rappel d'un truc, dans le livre "Street Smart" de lynda je-ne-sais-plus-comment, elle a une definition de son "Turtle soup" et "Turtle Soup +1".

Au final j'avais du me basser sur ses explications car dans son livres les système proposé sont très "carré" en tout cas elle ne laisse presque pas de place à l'interpretation ;-)

Re: Turtles trading

par ladefense92800 » 17 déc. 2015 10:50

- falex : c est la verité .

Re: Turtles trading

par ladefense92800 » 17 déc. 2015 10:50

Pour les curieux c est un bouquin qui existe en français .

Re: Turtles trading

par falex » 17 déc. 2015 11:01

Bon alors les seul truc que j'ai gardé dans mon prt, c'était les indicateur de croisement de prix 20/4.

Je n'ai pas retrouvé de backtest, donc soit je ne suis pas allé jusque là, soit j'ai supprimer lors d'un ménage de printemps :-)

---

Je vais plutot te donner un conseil sur la méthodo de travail.

Quand j'ai un descriptif comme celui des tortues, je commence par mettre à plat et à écrirer sur une feuille la lsite des conditions stricte qui vont donner un signal d'entrée et un signal de sortie.
Ensuite je commence TOUJOURS par coder un indicateurs pour tester sur l'historique ces conditions.

Une fois que ton indicateur semble être bon, alors je passe au codage du backtest.
En faisant ainsi tu décorélles la aprtei signal et la aprtie gestion du trade car en faisant tout dans un backtest tu ne peux pas débugguer la partie signal "facilement".

En résumé :
1) Check des conditions de signal
2) Indicateur avec le signaux (avec une variable de sorite du style +1/-1 pour le signal et idem pour le signal de sortie, que tu vas grapher en historgramme avec des couleurs différentes)
3) Uen fois que tu as checker qu'il y a aucune erreur dans tes signaux, alors tu copie colles la aprtie signal dans un backet et tu rajoutes les mécanismes d'entrée/sortie de trade.

Good luck jim' (ce message s'autodétruira dans 20secondes :lol:)

---

Ladefense : "google est ton ami" pour la version en ANGLICHE ;-) j'ai jamais réussi à trouver le pdf en français. Enfin c'est pas de l'anglais très dur, c'est pas de la literrature, donc pas très compliqué à comprendre.

Re: Turtles trading

par plataxis » 17 déc. 2015 11:05

Merci Falex :mercichinois:

Le PDF en français :
./download/file.php?id=29179&sid=1805622b4914f83f5611ef1c89bbff1d
(223.59 Kio) Téléchargé 823 fois

Re: Turtles trading

par falex » 17 déc. 2015 11:06

Turtle soup version Lynda :
Here are the rules:
FOR BUYS (SELLS ARE REVERSED)
1. Today must make a new 20-day low-the lower the better.
2. The previous 20-day low must have occurred at least four trading sessions earlier. This is
very important.
3. After the market falls below the prior 20-day low, place an entry buy stop 5-10 ticks above
the previous 20-day
low. This buy stop is good for today only.
4. If the buy stop is filled, immediately place an initial good-till -canceled sell stoploss one tick
under today's low.
5. As the position becomes profitable, use a trailing stop to prevent giving back profits. Some of
these trades will last two to three hours and some will last a few days. Due to the volatility
and the noise at these 20-day high and
low points, each market behaves differently.
6. Reentry Rule: If you are stopped out on either day one or day two of the trade, you may
reenter on a buy Stop at your original entry price level (day one and day two only). By doing
this, you should increase your profitability by a small amount.
Et Turtle Soup plus un, toujours version Lynda :
FOR BUYS (SELLS ARE REVERSED)
1. The market makes a new 20-day low. The previous 20-bar low must have been made at
least three trading sessions earlier. The close of the new low (day one) must be at or below
the previous 20-bar low
2. An entry buy stop is placed the next day (day two) at the earlier 20 day low. If you are not
filled on day two, the trade is canceled.
3. If filled, place a protective sell stop one tick under the lower of the day-one low or the day-two
low.
4. Take partial profits within two to six bars and trail a stop on the balance of your position.
Ben je ne sais pas vous, mais même avec un des rares écrits ou les système de traeding sont écrits avec des règles, celles-ci manquent de définition dans les détails ...

C'est ainsi.
---
Plataxis, j'en ai encore une autre version que la tienne ;-) et surtout sans pub pour un vendeur de système ;-)

Re: Turtles trading

par ladefense92800 » 17 déc. 2015 11:08

Ladefense : "google est ton ami" pour la version en ANGLICHE ;-) j'ai jamais réussi à trouver le pdf en français. Enfin c'est pas de l'anglais très dur, c'est pas de la literrature, donc pas très compliqué à comprendre.

t inquiete j ai plus que google ....he he .

et puis un bouquin ça s achete et ça se revend .... oui pas de l anglais tres dur mais des fois les details sont importants .... :mercichinois:

Sujets similaires
Day trading contre swing trading
par didier54 » 24 août 2014 17:02 (15 Réponses)
Projet création Salle de Trading - Trading Room
par jctrader » 20 sept. 2014 16:53 (21 Réponses)
Projet wireless light trading ;) le trading en lumière ;)
Fichier(s) joint(s) par DarkPoule » 21 mars 2015 15:22 (18 Réponses)
Optimal Trading Stops and Algorithmic Trading
par bobbyO » 21 nov. 2015 13:02 (8 Réponses)
Méthode de trading en swing trading sur le DAX
par Patouaul » 31 janv. 2016 00:44 (18 Réponses)
Trading actions US via PRT Trading
Fichier(s) joint(s) par Benoist Rousseau » 14 févr. 2017 22:18 (25 Réponses)
Journal de trading scalping day trading - Benoist Rousseau
Fichier(s) joint(s) par Delo » 04 mars 2018 20:25 (351 Réponses)
Analyse pour Le Day Trading et Le Swing Trading
par Amarantine » 03 janv. 2019 21:46 (2 Réponses)
Trading dax vs Trading dow
par Toto le Héros » 03 juin 2019 16:43 (6 Réponses)