|
Right Paul, no loops required. I believe the user was just trying to "understand" what was happening by using the loop so I was showing the problem with the loop, which is an easy one to make. The simple solution is just: Buy = Cross( MACD(12,26), Signal(9) ); Better yet, store the T/A for subsequent use in Sell, Short, Cover, Plot statements, etc. md = MACD(12,26); sig = Signal(9); Buy = Cross( md, sig );
As for "Buy" is an array, I already noted Fred's original statement "Buy is a light switch, either 0 or 1". -- Terry -----Original Message-----
Of course, you don't need loops to do what Jerry's doing anyway BUT!!! "Buy" is an array of true/false values (ignoring scaling etc) NOT an array of High prices so Jerry is still going to come unstuck.
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 other support material please check also: http://www.amibroker.com/support.html
SPONSORED LINKS
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 __,_._,___ |
