BREAKDOWN SYSTEM BY MARK WEXLER

BREAKDOWN SYSTEM BY MARK WEXLER

Простая пробойная система с закрытием через опционально заданное количество баров.

С начала создаем функцию:

Type : Function, Name : Breakout_Range2

Inputs: 

price( numericseries),
look_bak(numeric);

Vars: bar_count(0),
max_price(h); {number of bars since last high}

If CurrentBar = 1
then Begin bar_count = 1;
{bar_count counts the number of bars since
a new high was made}End
Else Begin
If price > Highest(high, look_bak)[1]
{if this bar is the highest high of
the look_bak period} then Begin
if bar_count >= look_bak then Begin
Breakout_Range2=bar_count;
bar_count = 0;
End
Else {highest high but NOT since look_bak bars}
Begin bar_count = 0;
Breakout_Range2 = 0;
End;
End { of highestbar check }

Else {this isn’t the highest high }
Begin bar_count = bar_count + 1;

Breakout_Range2 = 0;
End;
End;

 

Потом создаем системму:
Type : Signal, Name : Breakout_Range2

Input:
look_bak(4),
n_bars(4);
If Breakout_Range2(h, look_bak) <> 0 then
{this would only occur if a new high price occured after n_bars of no such new high}
Buy ;
If BarsSinceEntry >= n_bars then ExitLong;

Подписаться
Уведомить о
0 комментариев
Межтекстовые Отзывы
Посмотреть все комментарии