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

Re: [amibroker] Float Analysis



PureBytes Links

Trading Reference Links

Dear Peter,

First - you can have a loops in AFL scripting
(take a look at http://www.amibroker.com/docs/ab400.html)

Second - you probably can do the whole thing without
the need to use script ;-)

Float = 30000000; // replace this with retrieving real float but please remember that
// this one is in 1's of shares (not 100's or 1000's)

// Cum( Volume ) gives accumulated volume
// Cum( Volume ) >= Float give "true" for all bars after cumulated volume
// is equal or greater to float
// ExRem() removes "true" on every bar after the first bar when above condition is met

dayone = ExRem( Cum( Volume ) >= Float, 0 );

graph0 = close;

// Now we simply calculate the most recent values of HighestHigh and LowestLow from dayone

hh = LastValue( HighestSince( dayone, high ) );
ll = LastValue( LowestSince( dayone, low ) );

graph1 = hh;
graph2 = ll;
graph1style = graph2style = 1;

Third: Ref() is fast. It was mentioned that Foreign() isn't that fast.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message ----- 
From: "Peter Gialames" <investor@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, September 19, 2001 9:28 PM
Subject: [amibroker] Float Analysis


> Hello Tomasz,
> 
> I am trying to code a volume analysis function similar to Steve Woods idea.
> This is a "backward cumulative count of the volume ... studied in relation
> to a stock's floating supply of shares."
> 
> Now float is a variable found in Quotes Plus that is easily accessible via
> 
> <%
> CInfo = new ActiveXObject("QuotesPlus.CompanyInfo");
> CInfo.Symbol = AFL("ticker");
> try
> {
> AFL("Float") = Number( CInfo.Float() );
> }
> catch( e )
> {
> AFL("Float") = 0;
> }
> %> //->Thanks Steve Wiser
> 
> Now that we have the Float we need to accumulate volume, on a day to day
> basis, backwards until the accumulated volume is greater than the float
> (volume turnover). This is our starting date.
> 
> From this date we need to find the highest high and the lowest low over this
> period of time and draw channel lines (horizontal line over highest high and
> horizontal line over lowest low).
> 
> Now where I am stuck is on how to accumulate the volume backwards. AFAIK
> the only way to do this is (excuse my VB syntax):
> 
> i=1
> do while accumVol <> float
> accumVol=ref(vol,-i)
> if ref(high,-i)>highestHIGH then
> highestHIGH=ref(high,-i)
> endif
> if ref(low,-i)<lowestLOW then
> lowestLOW=ref(low,-i)
> endif
> i=i+1
> loop
> 
> But AFL does not support looping, right? If there is another way of
> achieving this calculation, please let me know.
> 
> Also, I have read about the ref() function not being that efficient. Is
> there an easier way to reference other values in the array (close(-1),
> volume(-2), high(-i))?
> 
> Thanks in advance,
> Peter Gialames
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>