function run()
{
var *Price = series(price());
var *Trend = series(LowPass(Price,1000));
Stop = 4*ATR(100);
// Display a message box with the variables to be observed
// Click [Yes] for a single step, [No] for closing the box
static int debug = 1;
if(debug) debug = msg(
"Price = %.5f, Trend = %.5f, Stop = %.5f",
Price[0],
Trend[0],
Stop);
if(valley(Trend))
enterLong();
else if(peak(Trend))
enterShort();
}