- Katılım
- 23 Eki 2020
- Mesajlar
- 1,823
Turtle Trading System
Turtle trading is a most famous trading system; I wrote a series of articles to provide the basic concepts of turtle trading system. In this article, I will give you a few examples on how to apply the turtle systems in your trading by using MetaStock.One of the most commonly used tools for MetaStock is The Explorer, with this tool traders can filter out securities that do not match any given criteria. The criteria can be defined by writing MetaStock formula as the following example.
According to the turtle trading system, the shorter term entry system based on a 20-days breakout. Traders can easily write a formula for daily charts as follow.
H > Ref(HHV(H, 20), -1) OR L < Ref(LLV(L, 20), -1);
H = Today's high; L = Today's low
HHV(H, 20) = Highest value that the high price (H) has reached in the last 20 days.
LLV(L, 20) = Lowest value that the low price (L) has reached in the last 20 days.
Ref(HHV(H, 20), -1) = The highest high price in the last 20 days refer to yesterday.
Ref(LLV(L, 20), -1) = The lowest low price in the last 20 days refer to yesterday.
If traders want a list of securities that match the turtle exit system, 10-days low for long positions and 10-days high for short positions. The formula will be as follow.
L < Ref(LLV(L, 10), -1) OR H > Ref(HHV(H, 10), -1);
These are examples of how to apply trading systems by using MetaStock formula. Besides The Explorer, traders can also write the formula in other tools such as Expert Advisor or Indicator Builder as well.
Hope this information is useful for you. For more detailed information on providers, kindly refer to the Right Pane.
Turtle and Breakout System
BUY:
buy:=H>Ref(HHV( H,20),-1) ;
sell:=L<Ref( LLV(L,10) ,-1) OR (C<(ValueWhen( 1,H>Ref(HHV( H,20),-1) ,L)-(2*Fml( "CTA_N turtle indicator")) ) ) ;
a:=Cum(buy);
b:=ValueWhen( 1,sell,a) ;
trades:=a-b;
BUY1:=If(TRADES> 0,1,0);
N1:=(ValueWhen( 1,TRADES= 1,C)+(1*Fml( "CTA_N turtle indicator")) );
Sbuy2:= (BUY1=1) AND H>N1;
CC:=Cum(SBUY2) ;
D:=ValueWhen( 1,sell,CC) ;
TRADES2:=CC- D;
BUY2:=If(TRADES2> 0,2,0);
N2:=(ValueWhen( 1,TRADES2= 1,C)+(1*Fml( "CTA_N turtle indicator")) );
Sbuy3:= (BUY2=2) AND H>N2;
EE:=Cum(SBUY3) ;
F:=ValueWhen( 1,sell,EE) ;
TRADES3:=EE- F;
BUY3:=If(TRADES3> 0,3,0);
long:=(TRADES= 1 and ref(trades,- 1)=0) OR (TRADES2=1 and ref(trades2, -1)=0) OR (TRADES3=1 and ref(trades3, -1)=0);
long
____________ ___
SELL:
L<Ref(LLV(L, 10),-1) OR (C<(ValueWhen( 1,H>Ref(HHV( H,20),-1) ,L)-(2*Fml( "CTA_N turtle indicator")) ) )
ENTRI SIZE: % of avaible Equity
buy:=H>Ref(HHV( H,20),-1) ;
sell:=L<Ref( LLV(L,10) ,-1) OR (C<(ValueWhen( 1,H>Ref(HHV( H,20),-1) ,L)-(2*Fml( "CTA_N turtle indicator")) ) ) ;
a:=Cum(buy);
b:=ValueWhen( 1,sell,a) ;
trades:=a-b;
BUY1:=If(TRADES> 0,1,0);
N1:=(ValueWhen( 1,TRADES= 1,C)+(1*Fml( "CTA_N turtle indicator")) );
Sbuy2:= (BUY1=1) AND H>N1;
CC:=Cum(SBUY2) ;
D:=ValueWhen( 1,sell,CC) ;
TRADES2:=CC- D;
BUY2:=If(TRADES2> 0,2,0);
N2:=(ValueWhen( 1,TRADES2= 1,C)+(1*Fml( "CTA_N turtle indicator")) );
Sbuy3:= (BUY2=2) AND H>N2;
EE:=Cum(SBUY3) ;
F:=ValueWhen( 1,sell,EE) ;
TRADES3:=EE- F;
BUY3:=If(TRADES3> 0,3,0);
trade:=if(BUY1= 1 and buy2=0,0.33, if( buy2=2 and buy3=0,0.5,if( buy1=1 and buy2=2 and buy3=0,0.66, if(buy3=3, 1,0))));
trade
(19 * PREVIOUS+ATR( 20))/20
BUY2:=If(TRADES2> 0,2,0);
N2:=(ValueWhen( 1,TRADES2= 1,C)+(1*Fml( "CTA_N turtle indicator")) );
Sbuy3:= (BUY2=2) AND H>N2;
EE:=Cum(SBUY3) ;
F:=ValueWhen( 1,sell,EE) ;
TRADES3:=EE- F;
BUY3:=If(TRADES3> 0,3,0);
long:=(TRADES= 1 and ref(trades,- 1)=0) OR (TRADES2=1 and ref(trades2, -1)=0) OR (TRADES3=1 and ref(trades3, -1)=0);
long
____________ ___
formula "CTA_N turtle indicator"
(19 * PREVIOUS+ATR( 20))/20
kaynak :
Google Sites
Son düzenleme: