RE: TURTLE SOUP (PLUS ONE) Ansatz in ELA ? | |
Paintbar
Turtlesoupplus1(Function) INPUT:LENGTH(NUMERICSIMPLE),PREV(NUMERICSIMPLE);
VAR:HH(0),LL(0),NEWH(999),NEWL(999),TS1(0);
TS1=0; NEWH=NEWH+1; NEWL=NEWL+1; IF HH[1]>0 AND NEWH[1]>=PREV AND C>HH[1] THEN TS1=-1; IF LL[1]>0 AND NEWL[1]>=PREV AND CHH=HIGHEST(H,LENGTH); LL=LOWEST(L,LENGTH); IF H=HH THEN NEWH=0; IF L=LL THEN NEWL=0;
TURTLESOUPPLUS1=TS1;
T-Soup+1Buy(PaintBar) Input: LENGTH(20),PREV(4); IF TURTLESOUPPLUS1(LENGTH,PREV)=1 Then Begin Plot1(High,"High"); Plot2(Low,"Low"); IF CheckAlert Then Alert; End;
T-Soup+1Sell(PaintBar) Input: LENGTH(20),PREV(4); IF TURTLESOUPPLUS1(LENGTH,PREV)=-1 Then Begin Plot1(High,"High"); Plot2(Low,"Low"); IF CheckAlert Then Alert; End;
Indicator
INPUT:LENGTH(20),PREV(4),ENTRYADD(10 POINTS);
VAR:HH(0),LL(0),NEWH(999),NEWL(999), TSSELL(0),TSBUY(0),SLIFE(0),BLIFE(0);
{==== DAILY OR INTRADAY DATA ====} NEWH=NEWH+1; NEWL=NEWL+1; IF HH[1]>0 AND NEWH[1]>=PREV AND C>HH[1] THEN BEGIN TSSELL=HH[1]-ENTRYADD; SLIFE=2; END; IF LL[1]>0 AND NEWL[1]>=PREV AND C TSBUY=LL[1]+ENTRYADD; BLIFE=2; END; HH=HIGHEST(H,LENGTH); LL=LOWEST(L,LENGTH); IF H=HH THEN NEWH=0; IF L=LL THEN NEWL=0; IF SLIFE>0 THEN PLOT1(TSSELL,"TS+1-Sell") ELSE TSSELL=0; IF BLIFE>0 THEN PLOT2(TSBUY,"TS+1-Buy") ELSE TSBUY=0; SLIFE=SLIFE-1; BLIFE=BLIFE-1;
Signal
Input: LENGTH(20),PREV(4),ENTRYADD(10 POINTS); IF TURTLESOUPPLUS1(LENGTH,PREV)=1 Then Buy LOWEST(L,LENGTH)[1]+ENTRYADD Stop; ExitLong LOWEST(L,LENGTH) Stop; IF TURTLESOUPPLUS1(LENGTH,PREV)=-1 Then Sell HIGHEST(H,LENGTH)[1]-ENTRYADD Stop; ExitShort HIGHEST(H,LENGTH) Stop;
|