What Is An Unfilled Gap? Are They Profitable? (Amibroker And Tradestation Code)
The relevant article can be found here.
In plain English:
Strategy 1:
- Yesterday was a gap down day.
- Today is an inside day.
- If 1 and 2 are true, we enter at the close.
- We exit after 5 days.
Strategy 2:
- Today is a gap down day.
- The two-day RSI is below 30.
- If both 1 and 2 are true, then enter at the close.
- We exit after x days.
Strategy 3:
- Two days ago was a down day.
- Yesterday was a down day.
- Today is a gap down.
- If 1, 2, and 3 are true, go long at the close.
- Exit after x days.
Amibroker code:
Strategy 1:
Buy=Inside() AND Ref(H,-1)<Ref(L,-2);
BuyPrice=Close;
Sell=C>Ref(H,-1);
SellPrice=Close;
Timestop:
oddis=Optimize(“Time based exit”,15,1,20,1);
ApplyStop(stopTypeNBar,stopModeBars,oddis,1);
Strategy 2:
Buy= GapDown() AND RSI(2)<30 ;
BuyPrice=Close;
Sell= RSI(99)>99; //no exit (in practice) thus forcing time stop exit
SellPrice=Close;
ApplyStop(stopTypeNBar,stopModeBars,oddis,1);
Strategy 3:
Buy= GapDown() AND Ref(C,-1)<Ref(C,-2) AND Ref(C,-2)<Ref(C,-3) ;
BuyPrice=Close;
Sell= RSI(99)>99; //no exit (in practice) thus forcing time stop exit
SellPrice=Close;
ApplyStop(stopTypeNBar,stopModeBars,oddis,1);
Tradestation:
Strategy 1:
{
Are unfilled gaps profitable? (Strategy 94A)
Yesterday was a gap down day.
Today is an inside day.
If 1 and 2 are true, we enter at the close.
We exit after 5 days.
}
Inputs:
HoldBars(5);
if InsideBar(High, Low) = true AND High[1] < Low[2] Then
Buy this bar on close;
if Barssinceentry(0) >= HoldBars Then
Sell this bar on close;
Strategy 2:
{
Are unfilled gaps profitable? (Strategy 94B)
Today is a gap down day.
The two-day RSI is below 30.
If both 1 and 2 are true, then enter at the close.
We exit after 5 days.
}
Inputs:
HoldBars(5),
RsiLookback(2),
RsiTreshold(30);
if High < Low[1] AND RSI(Close, RsiLookback) < RsiTreshold Then
Buy this bar on close;
if Barssinceentry(0) >= HoldBars Then
Sell this bar on close;
Strategy 3:
{
Are unfilled gaps profitable? (Strategy 94C)
Two days ago was a down day.
Yesterday was a down day.
Today is a gap down.
If 1, 2, and 3 are true, go long at the close.
Exit after 5 days.
}
Inputs: HoldBars(5);
if High < Low[1] AND Close[1] < Close[2] AND Close[2] < Close[3] Then
Buy this bar on close;
if Barssinceentry(0) >= HoldBars Then
Sell this bar on close;
Disclaimer: We are not financial advisors. Please do your own due diligence and investment research or consult a financial professional. All articles are our opinions – they are not suggestions to buy or sell any securities.
