<*>[Attachment(s) from Alan included below] Hi rvlv:
Thanks for your interest in helping me with my problem and for the code. I tried the code with a filtered list of the 100 stocks making up the QQQQ's (list attached) and here is my results: Ticker Date/Time BUY SELL uptrend downtrend BRCM 11/20/2009 0.00 1.00 8 0 DELL 11/20/2009 0.00 1.00 9 0 FWLT 11/20/2009 0.00 1.00 12 0 INTU 11/20/2009 0.00 1.00 11 0 LLTC 11/20/2009 0.00 1.00 9 0 NWSA 11/20/2009 0.00 1.00 11 0 What was immediately confusing to me is that the table shows that there has been no buy signal for BRCM (for example) but yet the table shows that BRCM has been in an uptrend for 8 days. After studying to code and the actual price chart I now understand how to read the table yet it is intuitively confusing. I think it would be less confusing if the table showed the date of the last buy, put a 1 in the buy column and showed how many days have gone by since the buy signal was given. Same with sell signals, but that's my opinion. However, the code does give the information I am looking for so thanks, and I appreciate the time spent helping me. Regards, Alan ram vel wrote: > > Hi Alan > please try this code it may help serve your purpose > -------------------------------------------------------------------------------- > //The following code will return a 1 when the negative DMI crosses > above the positive DMI. > mdmi = > MDI(13); > pdmi = > PDI(13); > NEGdmicrossing = > Cross(mdmi,pdmi); > POSITIVEdmicrossing = > Cross(pdmi,mdmi);* * > *Buy*=POSITIVEdmicrossing ; > ** > *Sell* =NEGdmicrossing; > BarsSince > ( POSITIVEdmicrossing ) ; > BarsSince > ( NEGdmicrossing ) ; > ** > *Filter*=*Buy* *OR* *Sell*; > AddColumn > (*Buy*,"BUY",format=1.2); > AddColumn > (*Sell*,"SELL",format=1.2); > AddColumn > ((BarsSince( POSITIVEdmicrossing )), "uptrend ",format=1.0); > AddColumn > ((BarsSince( NEGdmicrossing )), "downtrend ",format=1.0); > //- bars since Trading system toolbox reference > //SYNTAX BarsSince( ARRAY ) > //RETURNS ARRAY > //function Calculates the number of bars (time periods) that have > passed since ARRAY was True (OR 1) > //EXAMPLE BarsSince( MACD() < 0 ) > --------------------------------------------------------------------------------------------------------------------------------------------------- > regards > rvlv > ------------------------------- > > --- On *Sat, 11/21/09, Alan /<[email protected]>/* wrote: > > > From: Alan <[email protected]> > Subject: [amibroker] Days since DMI crossover > To: [email protected] > Date: Saturday, November 21, 2009, 2:51 PM > > The following code will return a 1 when the negative DMI crosses > above > the positive DMI. > > mdmi = MDI(13); > pdmi = PDI(13); > dmicrossing = Cross(mdmi,pdmi); > > However, what I want to know is how many days have passed since the > negative DMI crossed above the positive DMI. I have looked through > the > AFL formulas for a Days Since Crossing function but did not find one. > Can anyone help me with the code to perform this function? > > Thanks, > Alan > > > ------------------------------------ > > **** IMPORTANT PLEASE READ **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > TO GET TECHNICAL SUPPORT send an e-mail directly to > SUPPORT {at} amibroker.com > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > http://www.amibroker.com/feedback/ > <http://www.amibroker.com/feedback/> > (submissions sent via other channels won't be considered) > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ <http://www.amibroker.com/devlog/> > > Yahoo! Groups Links > > > (Yahoo! ID required) > > > [email protected] > > <http://us.mc342.mail.yahoo.com/mc/[email protected]> > > > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 4627 (20091121) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com <*>Attachment(s) from Alan: <*> 1 of 1 File(s) http://groups.yahoo.com/group/amibroker/attachments/folder/807094956/item/list <*> QQQQ.tls ------------------------------------ **** IMPORTANT PLEASE READ **** This group is for the discussion between users only. This is *NOT* technical support channel. TO GET TECHNICAL SUPPORT send an e-mail directly to SUPPORT {at} amibroker.com TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at http://www.amibroker.com/feedback/ (submissions sent via other channels won't be considered) For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: http://www.amibroker.com/devlog/ 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: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
