Well in the interests of the community I had a go at creating the indicator & it looks right but you should all test it probably before relying on it & by all means please make changes where you see necessary.
function run(){
set(PLOTPRICE+PLOTNOW);
BarPeriod = 15;
LookBack = 500;
StartDate = 20120201;
NumDays = 1;
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]));
vars FextMapBuffer1 = series(0);
vars FextMapBuffer2 = series(0);
var flat = EMA(FextMapBuffer5,AvPeriod);
vars FextMapBuffer3 = series((flat * Gamma));
vars FextMapBuffer4 = series(0 - (flat * Gamma));
int NewWindow = 0;
plot("NewWindow",NewWindow,NEW,BLACK);
if(FextMapBuffer6[0] < FextMapBuffer6[1]) {
FextMapBuffer2[0] = FextMapBuffer6[0];
FextMapBuffer1[0] = 0;
plot("FextMapBuffer2",FextMapBuffer2[0],BARS,RED);
}
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);
}
Enjoy.