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

Re: [amibroker] Re: Automating Industry Composite Updates



PureBytes Links

Trading Reference Links

Just define what stocks are to be used for the markets, also i do not
think "X" works in foreign

you have used same variable NewHigh and NewLow, and ADv Dec for both
so you will only get a single value

You could also place all these into a single composite. Here is one solution

mark = "";
if(MarketID()==1) mark = "~NYSE";
if(MarketID()==3) mark = "~NASDQ";

AddToComposite(C > HHV(Ref(C, -1), 252), mark, "O");
AddToComposite(C < LLV(Ref(C, -1), 252), mark , "H");
AddToComposite(C - Ref(C, -1) > 0, mark , "L" );
AddToComposite(Ref(C, -1) - C > 0, mark , "C" );

NewHighY=Foreign("~NYSE","O");
NewLowY = Foreign("~NYSE","H");
NewHighQ=Foreign("~NASDQ","O");
NewLowQ = Foreign("~NASDQ","H");

AdvY = Foreign("~NYSE","L");
DecY = Foreign("~NYSE","C");
AdvQ = Foreign("~NASDQ","L");
DecQ = Foreign("~NASDQ","C");


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://www.aflwriting.com



On 26/01/07, areehoi <rhoierman@xxxxxxxxxxxxx> wrote:
> This is a subject I've wanted to also bring up.  I have a number of
> different composites and would like to run them all at once but don't
> know how. For instance some are on the watch list of the Nasdaq 100 or
> S & P 500.  The Addto Composite code below is for Adv/Dec and
> Newhi/Lo's of both the NYSE and Nasdaq.  When I run it on the entire
> database it will come up with same results for both the NYSE & Nasdaq.
>  If I run it with Filter on Market just "NYSE" the results are correct
> but then when I run on Nasdq both figures (for NYSE & Nasdq) are the
> same?  What do I need to do to correct this?  And, also, as mentioned
> before, be able to run all composites in one operation??  Thanks for
> any help one can offer to a non programmer.
>
> Dick H
>
>
>
> NYSE = "~" + MarketID(1);
> NASDQ = "~" + MarketID(3);
> AddToComposite(IIf(C > HHV(Ref(C, -1), 252), 1, 0), "~NYSENHi", "X");
> AddToComposite(IIf(C < LLV(Ref(C, -1), 252), 1, 0), "~NYSENLo", "X");
> AddToComposite(IIf(C > HHV(Ref(C, -1), 252), 1, 0), "~NASDQNHi", "X");
> AddToComposite(IIf(C < LLV(Ref(C, -1), 252), 1, 0), "~NASDQNLo", "X");
>
>
> NewHigh=Foreign("~NYSENHi","X");
> NewLow = Foreign("~NYSENLo","X");
> NewHigh=Foreign("~NASDQNHi","X");
> NewLow = Foreign("~NASDQNLo","X");
> ---------------------------------------------------------------------
> AddToComposite(IIf(C - Ref(C, -1) > 0, 1,0), "~NYSEAdv", "X" );
> AddToComposite(IIf(Ref(C, -1) - C > 0, 1,0), "~NYSEDec", "X" );
> AddToComposite(IIf(C - Ref(C, -1) > 0, 1,0), "~NASDQAdv", "X" );
> AddToComposite(IIf(Ref(C, -1) - C > 0, 1,0), "~NASDQDec", "X" );
>
> Adv = Foreign("~NYSEAdv","X");
> Dec = Foreign("~NYSEDec","X");
> Adv = Foreign("~NASDQAdv","X");
> Dec = Foreign("~NASDQDec","X");
>
>
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "sdp_51" <psean@xxx> wrote:
> >
> > Hey guys,
> >
> > I am constructing composite tickers at the moment for various
> > industries/groups and I would like to know if there is a way to
> > automatically run the scans on each group/industry based on various
> > AFLs I have written instead of choosing the group in the definition
> > of the scan at the time of scan.
> >
> > I know there is some sort of automation via JScript and/or VBScript
> > but I am not all that familiar with them.  Or I could create one
> > master AFL which would add individual ticker fields conditionally to
> > a certain composite ticker field if industry="mychoice".
> >
> > Easier way:  Are we able to identify a ticker's industry via AFL as
> > part of a scan?
> >
> > Harder way:  Are we able to automate the running of multiple scans on
> > various groups using various AFLs?
> >
> > Thanks again,
> > Sean
> >
>
>
>
>
> 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
>
> Yahoo! Groups Links
>
>
>
>

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.12/655 - Release Date: 1/28/2007 1:12 PM