The Big Three Trading Strategy (Amibroker And Tradestation Code)
The original article can be found here.
Amibroker code:
Strategy 1:
If the IBS is below 0.1, we buy QQQ at the close.
We sell at the close when the IBS is above 0.9.
ibs=(C-L)/(H-L) ;
Buy = ibs<0.1 ;
BuyPrice=Close;
Sell = ibs>0.9;
SellPrice=Close;
Strategy 2:
- When the 2-day RSI is below 10, we go long at the close.
- When the 2-day RSI is above 90, we sell at the close.
Buy = RSI(2)<10 ;
BuyPrice=Close;
Sell = RSI(2)>90;
SellPrice=Close;
Strategy 3:
- When the 100-day ADX is above 7, we are long S&P 500.
- When the 100-day ADX is below 7, we are out of the market.
Buy = ADX(100)>7 ;
BuyPrice=Close;
Sell = ADX(100)<7 ;
SellPrice=Close;
Tradestation code:
{
Big three strategy (no 144A):
If the IBS is below 0.1, we buy QQQ at the close.
We sell at the close when the IBS is above 0.9.
}
Inputs:
BuyTreshold(0.1),
SellTreshold(0.9);
Vars:
ibs(0);
ibs=(C-L)/(H-L);
if ibs<BuyTreshold Then
Buy this bar at close;
if ibs>SellTreshold Then
Sell this bar at close;
{
Big three strategy (no 144B):
When the 2-day RSI is below 10, we go long at the close.
When the 2-day RSI is above 90, we sell at the close.
}
Inputs:
Lookback(2),
BuyTreshold(10),
SellTreshold(90);
if RSI(C,Lookback)<BuyTreshold Then
Buy this bar at close;
if RSI(C,Lookback)>SellTreshold Then
Sell this bar at close;
{
Big three strategy (no 144C):
When the 100-day ADX is above 7, we are long S&P 500.
When the 100-day ADX is below 7, we are out of the market.
}
Inputs:
Lookback(100),
BuyTreshold(7),
SellTreshold(7);
if ADX(Lookback)>BuyTreshold Then
Buy this bar at close;
if ADX(Lookback)<SellTreshold Then
Sell this bar at close;
