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

Re: Ticker Count



PureBytes Links

Trading Reference Links

Dimitris,

If I can impose further on yout time, I have a couple of questions 
about the code which you sent me.

Firstly, I have added these three lines of code so that I can view 
and check the tickers which "gained" in the Explore Window:

Filter=1;
NumColumns=2;
Column0=Values;

For the custom indicator, I have added some additional lines so that 
it now reads:

Graph2=Foreign("_GAINERS","V");
Graph2Style=6;
Graph2Color=7;
Title=Name()+" # Gainers "+WriteVal(Graph2,1);

These are my two questions:

1 The WriteVal expression correctly shows the number of gainers in 
the title bar of the indicator panel. However, the histogram bar 
shows an odd number (eg 9.75 instead of 10. or 3.25 instead of 4). 
These odd numbers are those read of the side scale, or the number 
which shows when you hover the cursor on the bar. As the vbscript 
increments by "1" in the loop, where does this odd fractional number 
come from???

2 The number of tickers in the Defined Filter will vary. I am using 
a color bar in the histogram. Can the indicator code be modified so 
that it shows a different color when the "Gainers" exceed 50% of the 
tickers in the defined watchlist???

~kb~ (Can't wait for the coffee add-in)

--- In amibroker@xxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> wrote:
> Except if we have some coffee interface in some 3.85 edition.
> Nobody knows Tomasz "secret" plans.
> Have a nice day,
> DT
> --- In amibroker@xxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> wrote:
> > Well, yes.
> > Hot morning coffee for example.
> > DT
> > --- In amibroker@xxxx, kbennett@xxxx wrote:
> > > 
> > > Dimitris,
> > > Thank you for your prompt and super helpful advice. That's 
> exactly 
> > > what I needed.
> > > Is there anything this program will not do???
> > > ~kb~
> > > 
> > > --- In amibroker@xxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> > > > /*GAINERS*/
> > > > values = C>Ref(C,-1);
> > > > EnableScript("vbscript");
> > > > days = Day();
> > > > months = Month();
> > > > years = Year();
> > > > initialize = Status("stocknum") == 0;
> > > > <%
> > > > Name = "_GAINERS"
> > > > days = AFL("days")
> > > > months = AFL("months")
> > > > years = AFL("years")
> > > > values = AFL("values")
> > > > initialize = AFL("initialize")
> > > > Set oAB = CreateObject("Broker.Application")
> > > > If initialize Then
> > > > oAB.Stocks.Remove( Name )
> > > > End If
> > > > Set comp = oAB.Stocks.Add( Name )
> > > > For i = 0 To UBound( days )
> > > > Set qt = comp.Quotations.Add( years( i ) & "-" & months( 
> i ) 
> > > & "-
> > > > " & days( i ) )
> > > > If values( i ) = 1 Then qt.Volume = qt.Volume + 1
> > > > Next
> > > > If initialize Then
> > > > oAB.RefreshAll()
> > > > End If
> > > > %>
> > > > Buy = 0;
> > > > 
> > > > PASTE IN AUTOMATIC ANALYSIS,
> > > > SELECT
> > > > *Apply to->Use filter->Define->your watch list
> > > > *Range All quotations
> > > > and SCAN.
> > > > IN INDICATOR BUILDER PASTE THE
> > > > Graph0=Foreign("_GAINERS","V");
> > > > and you will have the Gainers graph.
> > > > 
> > > > Dimitris Tsokakis
> > > > --- In amibroker@xxxx, kbennett@xxxx wrote:
> > > > > 
> > > > > I have a watchlist of bellweather stocks which I monitor 
> daily, 
> > > and 
> > > > > pass the closing prices to Excel. In Excel I count the 
number 
> > of 
> > > > > gainers and chart the result over time.
> > > > > Is it possible to do this in AFL and to use the analysis to 
> > > produce 
> > > > a 
> > > > > custom indicator?
> > > > > Thanks for any help or guidance.
> > > > > kb