The Russell 2000 Rebalancing Strategy (Amibroker And Tradestation Code)
The strategy in plain English:
- Buy on the close on the first trading day after the 23rd of June.
- Sell on the close on the first trading day of July.
Click here for the original article.
Amibroker code:
Buy= Day()>23 AND Month()==6 ;
buyPrice= close;
Sell= Month()==7 ;
sellPrice= Close ;
A hedged position with S&P 500 looks like this:
if( Name() == “^RUT” )
{
Buy= Day()>23 AND Month()==6;
BuyPrice=Close ;
Sell= Month()==7;
SellPrice=Close;
}
if( Name() == “^gspc” )
{
Short= Day()>23 AND Month()==6;
shortPrice=Close ;
Cover= Month()==7;
coverPrice=Close;
}
Tradestation code:
{
Strategy Russell 2000 rebalancing strategy (no 22):
Buy on the close on the first trading day after the 23rd of June.
Sell on the close on the first trading day of July.
}
if (DayOfMonth(Date)>23) and (Month(Date)=6) then
Buy this bar at close;
if (Month(Date)=7) then
Sell this bar at close;
Disclosure: 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.
