[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Trade Signals in different time frames



PureBytes Links

Trading Reference Links

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





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/