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

Re: Float Analysis Revisited



PureBytes Links

Trading Reference Links

Hi Peter,
The yesterday´s value of cum(v1) is LastValue(Ref(Cum(V1),-1))
[and NOT ref(LastValue(Cum(V1)),-1)]
So, the AFL is like

V1=V/3000000;
VALUE=Cum(V1);/*The sum of V anytime*/
VALUE0=LastValue(Cum(V1));/*The last value of sum of V*/
VALUE1=LastValue(Ref(Cum(V1),-1));/*Yesterday´s value of sum of V*/
VALUE5=LastValue(Ref(Cum(V1),-5));/*The sum of V, 5 days ago*/
MaxGraph=6;
S1=VALUE0-VALUE;/*Put here VALUE1-VALUE or VALUE5-VALUE etc*/
COND=S1>4;/*4 is your "float"*/
H1=HighestSince(COND,H);
L1=LowestSince(COND,L);
T1=ValueWhen(COND<Ref(cond,-1),Cum(1));
Graph1=IIf(Cum(1)>=T1,LastValue(H1),-1e10);
Graph3=IIf(Cum(1)>=T1,LastValue(L1),-1e10);
Graph0=C;
Graph0Style=64;
Graph0BarColor=1;
GRAPHXSPACE=2;
Graph1BarColor=8;
Graph3BarColor=9;

Dimitris Tsokakis
--- In amibroker@xxxx, "Peter Gialames" <investor@xxxx> wrote:
> Tomasz, Dimitris et all,
> 
> If I wanted to modify the float analysis code (below) to start 
counting
> backward from any date entered how would I do that?
> 
> My problem is that I do not completely understand the line
> lastvalue(cum(volume))-cum(volume). The way I read it is to sum 
all the
> volume on a given chart and subtract this from the last value of the
> cum(volume) array. Now once the cumvol < float this is our 
starting point.
> But what if I wanted to start the counting backwards yesterday - or 
five
> days ago?
> 
> I am going to do this in VB also to practice the new powerful 
features of
> AmiBroker, but an explination of how to do this in AFL would be 
appreciated.
> 
> Peter Gialames
> 
> MaxGraph = 9;
> 
> EnableScript("jscript");
> 
> // this is to show only one entry per stock
> 
> ticker = Name();
> 
> <%
> CInfo = AFL.CreateStaticObject("QuotesPlus.CompanyInfo");
> CInfo.Symbol = AFL("ticker");
> 
> // try-catch block handles the situation when
> // QuotesPlus object returns strange values
> 
> try
> {
> AFL("Float") = Number( CInfo.Float() )*1000000;
> }
> catch( e )
> {
> AFL("Float") = 0;
> }
> 
> %>
> 
> cumvol = LastValue( Cum( Volume ) ) - Cum( Volume );
> lastrange = cumvol < (float);
> dayone = ExRem( lastrange, 0 );
> 
> Graph0 = Close;
> 
> 
> hh = LastValue( HighestSince( dayone, High ) );
> ll = LastValue( LowestSince( dayone, Low ) );
> 
> Graph0 = Close;
> Graph0Style=64;
> Graph0Color=2;
> 
> Graph1 = IIf( lastrange, hh, -1e10 );
> Graph2 = IIf( lastrange, ll, -1e10 );
> Graph1Style = Graph2Style = 1;