Баннер МОФТ

Легендарная Черепаха!!! (Ричард Деннис)

Обзор торговых стратегий (ТС). Какие пары лучше? Когда лучше выходить на рынок? Какие объемы использовать при торговле? Когда закрываться и т.д. Обсуждая свои стратегии здесь, Вы сможете улучшить их.

Модератор: trader-master

Легендарная Черепаха!!! (Ричард Деннис)


Сообщение d-m7 » 12 дек 2012, 11:38

{***************************************************************************
Description : Turtle System #1
:
: Rules Implemented:
: -----------------
: Standard Donchian Entry/Exit Channels
: Contingency Risk Stop at 2N (2*ATR)
: Skip Rule after profitable trade
: Failsafe Entry exception to skip rule
: Turtle Position Sizing
:
: Rules Not Implemented:
: ---------------------
: Adding Multiple Units (scaling)
: Cascading 1/2N stop management
: Limiting units within a market complex
: Limiting units based on market correlation
: Limiting units based on direction (long/short)
: Requiring 1/2N portfolio profit before scaling (Strength Filter)
:
: NOTE: Portfolio rules are beyond the native
: capabilities of TradeStation platform
:
: Implementation is dual-use
: and can easily be modified
: to run as TradeStation indicator
: to assist and enable research
:
Provided By : Kevin Sven Berg
: [Spam Link]
: January 23, 2004
: Copyright (c) 2004, Kevin Sven Berg
Reference : [Spam Link]
: With special thank you to Curtis Faith
****************************************************************************}

Input: Echannel(20), { Entry Channel Length }
Xchannel(10), { Exit Channel Length }
FailSafe(50), { Failsafe Channel Length }
PcntEquity(0.01), { Fixed Fraction of Account Equity }
MaxCon(1000), { Maximum Number of Contracts that can be Traded }
Acctsize(1000000); { Starting Account Size }

Var: LE(0), { Long Entry Stop }
LX(0), { Long Exit Stop }
LEF(0), { Long Entry Failsafe Stop }
SE(0), { Short Entry Stop }
SX(0), { Short Exit Stop }
SEF(0), { Short Entry Failsafe Stop }
LX2N(0), { Turtle 2N Long Stop }
SX2N(0), { Turtle 2N Short Stop }
CON(0), { Number of Contracts }
ATR(0), { Average TrueRange }
ATRbars(20), { Length of ATR }
Bias(0), { Tracking Position: Bias > 0 = LONG, Bias < 0 = Short }
EPrice(0), { Entry Price }
XPrice(0), { Exit Price }
OE(0), { Open Equity }
PL(0), { Profit/Loss for Single Lot }
UseFailsafe(true); { Skip Next Trade -> Switch to Failsafe }

{---------------------------------------------------------------------------
Entry and Exit Channels
(a) System #1 Entry channel length is Echannel
(b) System #1 Exit channel length is Xchannel
(c) Failsafe entry channel length is FailSafe

Always take highest or lowest channel counting from prior bar
since we don't have knowledge of today's high
when placing the stop order
Channel entry is 1 tick beyond channel
---------------------------------------------------------------------------}

{ Entry }
LE = Highest(High,Echannel)[1] + 1 point;
SE = Lowest(Low,Echannel)[1] - 1 point;
LEF = Highest(High,FailSafe)[1] + 1 point;
SEF = Lowest(Low,FailSafe)[1] - 1 point;

{ Exit }
LX = Lowest(Low,Xchannel)[1] - 1 point;
SX = Highest(High,Xchannel)[1] + 1 point;

{---------------------------------------------------------------------------
Turtle Money Management
Calculate Turtle N = ATR
Calculate number of contracts in one unit
Cap maximum number of contracts per user parameter
Setup to trade 1-unit
---------------------------------------------------------------------------}

ATR = Average(TrueRange,ATRbars);
{CON =(PcntEquity*(Acctsize + NetProfit))/(ATR*BigPointValue);}
CON = 1;
CON = MinList(CON, MaxCon);
d-m7
 
Сообщений: 2
Зарегистрирован: 12 дек 2012, 11:28
Баллы репутации: 0
Добавить балл в репутациюВычесть балл из репутации

Re: Легендарная Черепаха!!! (Ричард Деннис)


Сообщение d-m7 » 12 дек 2012, 11:39

{---------------------------------------------------------------------------
Simulating System #1
Duplicate TS entry, exit and stops so that we can implement skip rule
This logic tracks position for System #1
including if last trade was profitable
Bias is an integer representing SHORT, NEUTRAL, or LONG (-1, 0, +1)
If last trade was profitable, then skip next System #1 signal
In truth, skipping signal is switching to failsafe entry

Bias > 0 means we have a long position, so process long exits
Bias < 0 means we have a short position, so process short exits
Bias = 0 means there is no position, so process long and short entries

Fills are assumed to be stop price or at least low of the gap
[ksb] Investigate using open when simulating gap conditions
---------------------------------------------------------------------------}
if bias > 0 then
begin
LX2N = EPrice - (2*ATR);
if (L < LX) then { fill exit stop }
begin
XPrice = MinList(LX, H);
PL = bias * (XPrice - EPrice);
Bias = 0;
end;
if (L < LX2N) then
begin
XPrice = MinList(LX2N, H);
PL = bias * (XPrice - EPrice);
Bias = 0;
end;
{only works when this code used in an indicator}
{if (0 = bias) then Plot2(XPrice, "X");}
end
else if bias < 0 then
begin
SX2N = EPrice + (2*ATR);
if (H > SX) then { fill exit stop }
begin
XPrice = MaxList(SX, L);
PL = bias * (XPrice - EPrice);
Bias = 0;
end;
if (H > SX2N) then
begin
XPrice = MaxList(SX2N, L);
PL = bias * (XPrice - EPrice);
Bias = 0;
end;
{only works when this code used in an indicator}
{if (0 = bias) then Plot2(XPrice, "X");}
end;

if 0 = bias then
begin
if (H > LE) then { fill }
begin
EPrice = MaxList(LE, L); { Account for Gaps }
Bias = +1;
{only works when this code used in an indicator}
{Plot1(EPrice, "E");}
end
else if (L < SE) then
begin
EPrice = MinList(SE, H); { Account for Gaps }
Bias = -1;
{only works when this code used in an indicator}
{Plot1(EPrice, "E");}
end;
end;


{---------------------------------------------------------------------------
Profit tracking for simulated System #1
Only calculate open equity if there is a position

Bias changes when position changes
Look for position change and transition to neutral
Capture last trade profit/loss

Winning trade means PL > 0
We will skip System #1
So failsafe must be activated after profit
---------------------------------------------------------------------------}

{ Calculate OpenEquity if we're in a position }
if (bias <> 0) then
OE = bias * (Close - EPrice)
else
OE = 0.0;

{ Trade Profit Filter }
UseFailsafe = (PL > 0);

{---------------------------------------------------------------------------
Entry/Exit System Execution
Switch system entry based on failsafe condition (skip rule)
System #1 channel exits always apply to open position
2N Stop always applies to open positions

TradeStation only executes ExitLong after Buy (no need for condition)
TradeStation only executes ExitShort after Sell (no need for condition)
---------------------------------------------------------------------------}

if (UseFailsafe) then
begin
Buy("FailsafeLE") CON Contracts LEF stop;
Sell( "FailsafeSE") CON Contracts SEF stop;
end
else
begin
Buy("CBO Hi") CON Contracts LE stop;
Sell("CBO Lo") CON Contracts SE stop;
end;

{ Channel Exits }
ExitLong("LX") LX stop;
ExitShort("SX") SX stop;

{ Volatility Stop }
ExitLong("2N Stop LX") LX2N stop;
ExitShort("2N Stop SX") SX2N stop;


и график евро часовка (60 минут) за 5 лет!
d-m7
 
Сообщений: 2
Зарегистрирован: 12 дек 2012, 11:28
Баллы репутации: 0
Добавить балл в репутациюВычесть балл из репутации

Re: Легендарная Черепаха!!! (Ричард Деннис)


Сообщение ezom » 20 дек 2012, 20:17

Я ничего не понял . Где система черепах ? Только не говорите что они покупали на пробое 20 дневной
средней или 60 дневной средней по хаям . Это примитив . И стоп на 2 *ATR(20) тоже откуда свалился?
Что такое юнит ? Автор ..вы хотите тень на плетень навести или людям помочь ? Разъясните по человечески .Система состоит из паттерна-события и оценки риска , а у Вас я ничего не понял .
ezom
 
Сообщений: 3
Зарегистрирован: 20 дек 2012, 19:32
Баллы репутации: 0
Добавить балл в репутациюВычесть балл из репутации


Вернуться в Торговые стратегии (ТС).