Closed-End Fund Strategy (Amibroker Code)

The original article can be found here.

Logic in plain English:

  • When the 2-day RSI of the discount/premium ratio crosses below 10, we go long at the close.
  • When the 2-day RSI of the discount/premium ratio crosses above 60, we sell at the close.

Amibroker code:

Fremmed=Foreign("XETGX","close",fixup=1);
pair=Close/fremmed;
RSIpair=RSIa(pair,2);

Buy = RSIpair<10 ;
BuyPrice = Close ;
Sell = RSIpair>60 ;
SellPrice = Close ;