Turtle System For Probacktest Prorealtime

Messages
1
Likes
0
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!

-------

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
 
Top