Hello alan, Everything is good at my end...i checked / confirmed with charts bar per bar basis..in both scan and exploration mode * add this for exploration BuyPrice=ValueWhen(Buy,C); SellPrice=ValueWhen(Sell,C); Filter=Buy OR Sell ; AddColumn(IIf(Buy,BuyPrice,Null),"Buy Price", 6.2,1,colorGreen,70); AddColumn(IIf(Sell,SellPrice,Null),"sell Price", 6.2,1,colorOrange,70); Thank you
--- On Sun, 22/11/09, Alan <[email protected]> wrote: From: Alan <[email protected]> Subject: Re: [amibroker] Re=Days since DMI crossover To: [email protected] Date: Sunday, 22 November, 2009, 7:59 PM Hi soni67c: Thanks for the code. I tried it and here is a snippit of the results after a scan: Ticker Trade Date Close AAPL Sell 10/28/2009 192.4 AAPL Buy 11/5/2009 194.03 AAPL Sell 11/20/2009 199.92 ADBE Sell 10/22/2009 35.17 This table shows a sell signal on 10/28/09 while MDI is still positive, a buy signal on 11/05 when on the stock chart is shows a buy signal on 11/04, and the table shows a sell signal on 11/20/09 again while MDI is still positive. So I must not be doing something right. I am using a filter list of the QQQQ's and Scan set for n=30. Any ideas why I am getting these results? Regards, Alan soni67c wrote: > > Hello Alan, > Check this formula...this is what you want :). > > Range = Param(" +DI - D range", 10, 5, 30,1 ); > Plot(PDI(Range),"",5,1); > Plot(MDI(Range),"",4,1); > Plot(ADX(Range),"",13,1); > Buy = Cross(PDI(Range), MDI(Range)); > Sell = Cross(MDI(Range), PDI(Range)); > PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,20,0); > PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,20,0); > bars=SelectedValue(Min( BarsSince( Cross(PDI(Range) , MDI(Range) )), > BarsSince( Cross( MDI(Range), PDI(Range))) )); > prevclose=Ref(Close,-bars); > Com=EncodeColor(colorTan)+("\n\nCurrently the +DMI ("+Range+") is "+ > WriteIf(PDI(Range) > MDI(Range),"bullish","bearish")+", and it crossed "+ > WriteIf(PDI(Range) > MDI(Range),"above","below")+" -DMI ("+Range+") > ."+"\n"+EncodeColor(colorAqua)+ > WriteVal( Min( BarsSince( Cross( PDI(Range), MDI(Range) )), BarsSince( > Cross( MDI(Range), PDI(Range)))), 0.0)+ > " period(s) ago.")+EncodeColor(colorTan)+ > Com=("\n\nSince the +DMI crossed -DMI, "+Name()+ "'s price has : > ")+EncodeColor(colorGold)+"\n"+ > WriteIf(Close>prevclose,"increased %","decreased > %")+WriteVal(100*(Close-prevclose)/prevclose)+ > EncodeColor(colorTan)+Com=("\n\nAnd has ranged from a high of "+ > WriteVal(HHV(High,bars+1),6.2)+" to a low of > "+WriteVal(LLV(Low,bars+1),6.2)); > Title = EncodeColor(colorWhite)+ "ABS3" + " - " + Name() + > EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) + > " - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+" > "+"Hi-"+H+" "+"Lo-"+L+" "+ > "Cl-"+C+" "+ "Vol= "+ WriteVal(V)+ Com; > > Thank you > > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 4627 (20091121) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com ------------------------------------ **** 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 The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
