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

Re: [amibroker] Days since DMI crossover


  • Date: Sun, 22 Nov 2009 02:15:49 -0600
  • From: Alan <alan@xxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Days since DMI crossover

PureBytes Links

Trading Reference Links

I guess I am still confused.  When I do an Exploration over the last 30 
days I get the following (I show only a snippit):

Ticker 	Date/Time 	BUY 	SELL 	uptrend  	downtrend 
AAPL 	10/30/2009 	0 	1 	78 	0
AAPL 	11/4/2009 	1 	0 	0 	3


What I am confused about is that the last signal from Apple was a buy 
signal on 11/4/09.  However the number of days since that signal shows 
up under the uptrend column as 0.  There has been 12 trading days since 
this last buy signal so why doesn't the uptrend column reflect the 
number of days since the last buy signal?

Alan,
P.S.  I guess the Forum program doesn't accept attachments to email as I 
do not see the QQQQ list I attached to my last email.


Alan wrote:
> 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 /<alan@xxxxxxxxxxxxxx>/* wrote:
>>
>>
>>     From: Alan <alan@xxxxxxxxxxxxxx>
>>     Subject: [amibroker] Days since DMI crossover
>>     To: amibroker@xxxxxxxxxxxxxxx
>>     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)
>>
>>
>>     amibroker-fullfeatured@xxxxxxxxxxxxxxx
>>     <http://us.mc342.mail.yahoo.com/mc/compose?to=amibroker-fullfeatured@xxxxxxxxxxxxxxx>
>>
>>
>>
>>
>>
>>
>> __________ 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
>
>
>
>
> __________ 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

<*> 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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/