Home › Forums › Trading System Mentor Course Community › AmiBroker Coding and AFL › barssince
Hi all, I’m trying to only take trades which occur early in a trend. So I’ve written MA1 = MA(C,10); MA2 = MA(C,100); MAxover = Cross(MA1,MA2);
Then included in buy criteria
BarsSince(MAxover<20);
but when adding this to a code which did previously work, the back tester gives me “no results” .
what am I doing wrong?
Thanks in advance Ian
Ian
Try Barssince(MAxover) < 20 Barssince(array) The array needs to return true (1) or false(0) , then assign the condition.
thanks Craig