this sample system is always in the market long or short
// AMA System
Input: Price(Close), Period(10), Damp(0), LimSlope(0.01), delay(1);
Vars: Ave(Price), Slope(0);
Ave = KaufmanAMA(Price, Period, Damp);
Slope = AbsValue(Ave - Ave[1]);
if Slope > LimSlope then begin
if Ave <...