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

Re: [amibroker] moving av cross over advice please



PureBytes Links

Trading Reference Links

Paul
The function you need to use is BarsSince as shown below.
 
Run this as an Explore against a Filter = family or ALL, and N last quotations = 1 and you'll get all crosses that occurred over the
last ten bars. 
 

// Filter= EMA(C,5) Cross EMA(C,10) within last 10 periods;

Cond1 = Cross(EMA(C,5),EMA(C,10));

Cond2 = BarsSince(Cond1);

Filter = Cond2 <= 10 AND Cond2>0;

AddColumn(Cond1,"Cross");

AddColumn(Cond2,"Bars Since Cross");

AddColumn(Filter,"Filter");

OR SET the filter as

Filter = Cond2 <= 10 AND Cond2>0 AND Status("LastBarinRange");

AND THE SCRIPT WILL BE A LITTLE MORE FORGIVING AS TO WHERE YOU SET THE DATE RANGE

Hope this helps

Joe L.

 

 

 

 
----- Original Message -----
From: paulradge
Sent: Monday, November 26, 2007 11:41 PM
Subject: [amibroker] moving av cross over advice please

Hi,
i tried posting this via the yahoo web site but it never came
through so posting directly,,,,(just in case it doubles up)

i'm trying to build an exploration that looks for 2 moving av's to have
crossed over within the last number of periods,,,i can build one for cross
over today but i'd like to build one that has crossed over "within" the last
number of periods.

ie
filter= ema(c,5) cross ema(c,10) within last 10 periods;

any advice or direct help please,,,
regards
Paul

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




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

__,_._,___