these muswt be same as the timeframeset cond115m=TimeFrameExpand(cond1,inHourly); cond215m=TimeFrameExpand(cond2,inHourly);
-- Cheers Graham AB-Write >< Professional AFL Writing Service Yes, I write AFL code to your requirements http://www.aflwriting.com On 24/03/07, pmxgs <[EMAIL PROTECTED]> wrote: > Hi, > > I'm having trouble getting this trade signals to work, I hope you can > help me. > My data is in 15 min bars. The first two conditions are checked in > hourly bars and the third is checked in 15 min bars. > AFL code is like these (I added the plots tto see if the conditions > were correctly checked): > Unfortunately it only generates one trade, although there are several > times when the three conditions are true. > Can someone tell me why this happens? > Maybe the time frame functions are not properly used. > > TimeFrameSet(inHourly); > cond1=C>EMA(C,20); > cond2=Ref(MACD(),-2)>0 AND Ref(MACD(),-2)>0;\\2 previous period macd > \\above zero > TimeFrameRestore(); > Cond3=C<EMA(C,20); > cond115m=TimeFrameExpand(cond1,in15Minute); > cond215m=TimeFrameExpand(cond2,in15Minute); > Buy=cond115m AND cond215m AND Cond3; > Sell=0; > Plot(Cond115m,"cond115m",colorGreen); > Plot(Cond215m,"cond215m",colorBlue); > Plot(Cond3,"cond3",colorRed); > > thanks
