PureBytes Links
Trading Reference Links
|
Hi Alan,
With AB there's usually more than one way to skin a cat. I prefer
explorations over scans for most purposes as I can display more information
about the output beyond buy and sell.
For example, I have an more extensive market relationships
exploration, a snippet of which follows which does what you asked about (I
think). This needs ver 5.2 or higher to run to total the columns of the
exploration. The benefit for me is that I am calculating a number of
relationships (e.g., price up & volume down) besides just price up and
price down and I can display them all after one exploration as a line of code at
the top of the exploration.
Peace and Justice --- Patrick
//
=============================================================
/*
PRICE--Volume RELATIONSHIPS
Run this exploration on different watchlists for S&P 500, Russell 2000,
NAZ 100, etc, stocks.
BREADTH
Breadth is a term referring to the number of rising versus the number of
falling stocks.
Breadth offers an alternative method of judging strength -- versus market
averages.
Breadth Grouping: Any group of stocks that have something in common. example
the 500 stocks of the S&P 500 can be used as a Breadth Grouping (which I
do). A group of bellwethers (which we choose subjectively, according to our own
experience) can serve as a Breadth Grouping. The Semiconductor index compontnts
as an example. Another is the Naz largest market cap stocks.
/*
Version(5.20); // requires
v5.20
Filter = 1;
BreadthUP = C > Ref(
C, -1 );
BreadthDown = C < Ref( C, -1 );
AddColumn (C, "Last
", 3.2, colorYellow, colorBlue, 75);
AddColumn (IIf(BreadthUP, 1, 0) , "BreadthUP", 8.0, colorWhite, colorDarkGreen );
AddColumn (IIf(BreadthDown, 1, 0) , "BreadthDown", 8.0, colorRed, colorBlack );
AddSummaryRows (1,3.0,4,5);
----- Original Message -----
Sent: Friday, November 20, 2009 8:48
AM
Subject: Re: [amibroker] Advancing Stocks
Scan or Exploration
Hi
Prashanth:
Yes this is what I am trying to do and thanks for the
code. I tried the code and got error messages for both the Scan and
Exploration modes. I am trying to resolve the
errors.
Regards, Alan
Prashanth wrote:
Hello,
If you are looking to get the figure of Advancing Stocks
(stocks that have closed above yesterday's close) and Declining Stocks,
you could use Add to Composite to create a ticker so that you can
co-relate today's figure with historical figure.
To do this, just
place the following in a AFL and hit Scan (All Symbols, All Quotations).
When the scan finishes, you should be able to get 2 tickers for
Advancing, Declining stocks.
Filter = 1; //
==================== Adv
Issues/Decliners============== AddToComposite(IIf(Close -
Ref(Close, -1) > 0, 1, 0), "~Adv", "X"
); AddToComposite(IIf(Ref(Close, -1) - Close > 0, 1, 0), "~Dec",
"X" );
Cheers
Prashanth
----- Original Message -----
From: "Alan Northam" <alan@xxxxxxxxxxxxus> To: <amibroker@xxxxxxxxxps.com> Sent:
Friday, November 20, 2009 20:30 PM Subject: [amibroker] Advancing Stocks
Scan or Exploration
> > I am new to writing Scans and
Explorations. Infact I don't know if I > want a Scan or an Exploration
so I hope that you all will be patient > with me. > > I
want to create a Scan or Exploration (which ever is the most proper) >
to determine how many stocks are still advancing in my database. >
However, I don't have a clue as to how to write the code. Can
someone > please provide this code for me so that I can study it and
learn from it? > > 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 > > >
__._,_.___
**** 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/
__,_._,___
|
|