Kyle, You would need to use AddToComposite to scan the entire universe (say, of the NYSE) for advances and declines, and create two custom symbols: "~adv" (sum of all advances) and "~dec" (sum of all declies). You can change "~adv" and "~dec" as you wish. Following the AddToComposite run, you can write a new AFL and access (using "Foreign") the three relevant symbols: (i) "~adv" (ii) "~dec" (iii) "SPX" (S&P 500 Index) Once these are accessed, you can easily program any trading idea and backtest/explore it. Regards, Amit Ehrenreich Market Testing Wizards www.markettestingwizards.com ________________________________
From: [email protected] on behalf of smithkt9675 Sent: Sat 3/29/2008 10:42 PM To: [email protected] Subject: [amibroker] Easy for experts Here's the code: Adv=Close>Ref(Close,-1); Dec=Close<Ref(Close,-1); CHADTP=(Sum(Adv,5)-Sum(Dec,5))/5; How do I write a buy/sell signal with arrows. The signals I want are: When CHADTP > 400 and S&P 500 Close < S&P 500 Close Previous Day +.10 = Sell When CHADTp < 400 and S&P 500 Close > S&P 500 Close Previous Day - .10 = Buy This seems so simple to me...I'm just getting caught up. You have to run CHADTP against all the constituents in the NYSE and you have to reference the S&P 500 at the same time. How do you run the scan/explore and simultaneously reference the foreign SPX to get arrows on the SPX for trade signals? Thanks in advance. Kyle
<<winmail.dat>>
