The Code is as below AndrewAMD...

function run()
{
StartDate = 2011;
EndDate = 2018;
set(TICKS);
//Lots = 100;
BarPeriod = 60;
LookBack = 150;
MaxLong = 1;
MaxShort = 1;

//Stop = 50*PIP;
//Trail = 40*PIP;
//TrailLock = 1;

//vars Low = series(priceLow());
//vars high = series(priceHigh());
vars Close = series(priceClose());
vars EMA7 = series(EMA(Close, 7));

if(Close[0] > EMA7[0])
enterLong(TrailingStopLong);


if(Close[0] < EMA7[0])
enterShort(TrailingStopShort);


plot("EMA7", EMA7[0], 0, BLUE);

set(PLOTNOW);
PlotWidth = 1200;
PlotHeight1 = 350;
}