TRIN Trading Strategy (Amibroker Code)

The original article can be found here.

TRIN strategy no 1:

  • When today’s TRIN reading is above 100, we go long the S&P 500 (SPY) at the close.
  • We sell at the close when today’s close is higher than yesterday’s high.

Amibroker code:

Fremmed=Foreign(“TRIN”,”close”,fixup=1);

Buy= fremmed>100 ;
buyPrice=Close;
Sell= C>Ref(H,-1);
sellPrice=Close ;

TRIN strategy no 2:

Fremmed=Foreign(“TRIN”,”close”,fixup=1);

Buy= RSI(2)<30 AND fremmed>100;
buyPrice=Close;
Sell= C>Ref(H,-1);
sellPrice=Close ;