Been playing some more there was still some errors Ive got it close but it still doesnt look exact though I think that may be because of the way the daily bars are grouped for FXCM and Zorro differently.

Quote:

function run(){
set(PLOTPRICE+PLOTNOW);
BarPeriod = 1440;
LookBack = 500;
StartDate = 20120901;
NumDays = 100;

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

vars FextMapBuffer1 = series(0);
vars FextMapBuffer2 = series(0);

//Median
vars Price = series(price());
vars MedianPrice = series(SMA(Price,500));

vars median = series(MACD(MedianPrice,FastEMA,SlowEMA,4));
vars median1 = series(MACD(MedianPrice+1,FastEMA,SlowEMA,4));

//Difference
vars FextMapBuffer6 = series(median[0] - median1[0]);

//Save current absoulte value
vars FextMapBuffer5 = series(abs(FextMapBuffer6[0]));

//Flat lines
vars flat = series(EMA(FextMapBuffer5,AvPeriod));
vars FextMapBuffer3 = series((flat[0] * Gamma));
vars FextMapBuffer4 = series(0 - (flat[0] * Gamma));

int NewWindow = 0;
plot("NewWindow",NewWindow,NEW,BLACK);

//Deceleration
if(FextMapBuffer6[0] < FextMapBuffer6[1]) {
FextMapBuffer2[0] = FextMapBuffer6[0];
FextMapBuffer1[0] = 0;
plot("FextMapBuffer2",FextMapBuffer2[0],BARS,RED);
}
//Acceleration
else if(FextMapBuffer6[0] > FextMapBuffer6[1]) {
FextMapBuffer1[0] = FextMapBuffer6[0];
FextMapBuffer2[0] = 0;
plot("FextMapBuffer1",FextMapBuffer1[0],BARS,BLUE);
}
plot("FextMapBuffer3",FextMapBuffer3[0],0,BLACK);
plot("FextMapBuffer4",FextMapBuffer4[0],0,BLACK);
}