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

Re: [amibroker] Days since DMI crossover


  • Date: Sat, 21 Nov 2009 20:44:19 -0800 (PST)
  • From: ram vel <rvlv@xxxxxxxxx>
  • Subject: Re: [amibroker] Days since DMI crossover

PureBytes Links

Trading Reference Links



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/
(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/




__._,_.___


**** 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/





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

__,_._,___