Actually all it was from what I can tell is some wrong brackets in your code.

Originally Posted By: "Code"

function run(){
LookBack = 500;


int FastEMA = 9;
int SlowEMA = 26;
int AvPeriod = 400;
var Gamma = 0.75;


vars med = series(MedPrice());

vars median = series(MACD(med,FastEMA,SlowEMA,4));
vars FextMapBuffer6 = series(median[0] - median[1]);
vars FextMapBuffer5 = series(abs(FextMapBuffer6[0]));

var flat = EMA(FextMapBuffer5,AvPeriod);
vars FextMapBuffer3 = series((flat * Gamma));
vars FextMapBuffer4 = series(0 - (flat * Gamma));

if(FextMapBuffer6 > FextMapBuffer3) {
exitShort();
enterLong();
}
if(FextMapBuffer6 < FextMapBuffer4) {
exitLong();
enterShort();
}
}


Updated code above. Though I do have one question for jcl, when we compare series for our entry codes do we use the pointers (FextMapBuffer) to the series or the last variable in our series in this case (FextMapBuffer6[0])?