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

[amibroker] How to write this is the first buy signal in the past 6 bars



PureBytes Links

Trading Reference Links

Folks,
 
Say i have buy = condition1;
Alert gets generated...Now few bars later again condition1 matches and another alert gets generated.
So i'd like add a filter that says Buy=condition1 and this is the first Buy in the past six bars so that buy signals don't repeat every other bar if the condition matches.
 
I tried something like this
 
 buy=condition1 and ref(buy,-1)=0 and and ref(buy,-2)=0 and and ref(buy,-3)=0 and and ref(buy,-4)=0.
 
But its not working.
 
How do I code this in AB 4.9?. Thanks.
 
cheers,Padhu
__._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___