Meb Faber Ivy Portfolio (Amibroker Code)

The article can be found here.

Plain English:

  • We allocate 20% to VTI, 10% EEM, 10% VEA, 20 VNQ, 20% IEI, and 20% DBC
  • We rebalance daily (to get a more compact equity curve, the results don’t vary much depending of it’s done weekly or annually)

Amibroker code:

setOption("holdminbars",1);


if( Name() == "VTI" )
{
setPositionSize(19.95*leverage,spsPercentOfEquity);

Buy= C>0 ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;


}


if( Name() == "EEM" )
{
setPositionSize(9.95*leverage,spsPercentOfEquity);

Buy= C>0 ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;


}

if( Name() == "VEA" )
{
setPositionSize(9.95*leverage,spsPercentOfEquity);

Buy= C>0 ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;


}

if( Name() == "VNQ" )
{
setPositionSize(19.95*leverage,spsPercentOfEquity);

Buy= C>0 ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;


}

if( Name() == "IEI" )
{
setPositionSize(19.95*leverage,spsPercentOfEquity);

Buy= C>0 ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;


}

if( Name() == "DBC" )
{
setPositionSize(19.95*leverage,spsPercentOfEquity);

Buy= C>0 ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;


}