function indicatortest(ma_short, ma_medium, ma_long) {
int ma_short = 15;
BarPeriod = 60*8;
PlotDate = 20150105;
//PlotBars = -100; //uncomment this and the chart is unreadable
vars Price = series(price());
set(PLOTNOW);
vars lowpass_MA_short = series(LowPass(Price, ma_short));
plot("low pass short", lowpass_MA_short,LINE, ORANGE);
if (valley(lowpass_MA_short)) {
plotGraph("valley", 1, priceLow(1) ,DOT, YELLOW );
}
else if (peak(lowpass_MA_short)) {
//shows 2 dots, both at the correct bar, one at the level of
// priceHigh, the other at the level of the trendline.
plotGraph("peak", 1, lowpass_MA_short[1], DOT, GREEN );
plotGraph("peak", 1, priceHigh(1), DOT, GREEN );
}
}