Three-Bar Inside Bar Pattern
The article by Johnan Prathap in this issue, “Three-Bar Inside Bar Pattern”, describes the trading strategy that uses an inside bar as a three-bar pattern for long and short positions.
Using Tradecision’s Strategy Builder, one needs to create the THREE-BAR INSIDE BAR PATTERN strategy:
Entry Long Rule:
var
Cond1:=false;
Cond2:=false;
end_var
if Close > Close\1\ then
Cond1 := true;
if High < High\1\ AND Low > Low\1\ then
Cond2 := true;
If IsInPosition() = false then
begin
If Cond1 and cond2\1\ and Cond1\2\ then
return true;
end;
return false;
Entry Short Rule:
var
Cond2:=false;
Cond3:=false;
end_var
if High < High\1\ AND Low > Low\1\ then
Cond2 := true;
if Close < Close\1\ then
Cond3 := true;
If IsInPosition() = false then
begin
If Cond3 and cond2\1\ and Cond3\2\ then
return true;
end;
return false;
Exit Long Rule:
If IsLongPosition() = true then
return true;
return false;
Exit Long Limit Price:
var
Tr:=0.75;
end_var
return SignalEntryPrice +
(SignalEntryPrice * Tr/100);
Exit Long Stop Price:
var
Sl:=0.75;
end_var
return SignalEntryPrice -
(SignalEntryPrice * Sl/100);
Exit Short Rule:
If IsShortPosition() = true then
return true;
return false;
Exit Short Limit Price:
var
Tr:=0.75;
end_var
return SignalEntryPrice -
(SignalEntryPrice * Tr/100);
Exit Short Stop Price:
var
Sl:=0.75;
end_var
return SignalEntryPrice +
(SignalEntryPrice * Sl/100);
|