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

[amibroker] Re: Up / Down Volume Ratio AFL Code ?



PureBytes Links

Trading Reference Links

Here's an up/down ratio formula presented some mnths ago at tour
AmiBroker NT group by Mark McClelland. Hope it is some help.

Dick H.
/*Determine the ratio of Up days to Down days for a given number of
days back from today Mark McClelland 07/08/04, Mark.mcc@xxxxxxx*/

Number_of_days =65;	//Set number days of interest
upday = C>Ref(C,-1);  //Creater arrays that identify the "direction"
downday = Ref(C,-1)>C;  //of eachday
unchangedday=Ref(C,-1)==C;

Countupdays =Sum(upday,number_of_days); //Count the number of days for
each 
Countdowndays =Sum(downday,number_of_days); // direction of # of days
nterest
Countunchangeddays =Sum(unchangedday,number_of_days);

Updownratio = Countupdays/Countdowndays; //Calculate the ratio

Filter =C>0; //Set the filter criteria

AddColumn(Countupdays,"UpDays",4.0);//Display the results
AddColumn(Countdowndays,"DownDays",4.0);
AddColumn(Countunchangeddays,"UnchangedDays",4.0);
AddColumn(Countupdays = Countdowndays,"Up+Down",4.0);
AddColumn(Number_of_days,"TotalDays",4.0);

AddColumn(updownratio,"Up/Down Ratio",3.2);
AddColumn(Countupdays/(Number_of_days),"Up/TotalDays",3.2);
AddColumn(Countdowndays/(Number_of_days),"Down/TotalDays",3.2);

AddColumn (MA(V,50), "MA(V,50)"); 

--- In amibroker@xxxxxxxxxxxxxxx, "sthlm_69" <sthlm_69@xxxx> wrote:
> Graham,
> 
> If coded, is should be the sum of shares/volume traded on up-days 
> divided by the sum on down-days for x-periods. 
> 
> Regards...
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> 
>  Can you provide some details of it?
>  
> 
> 
> On 5/25/05, sthlm_69 <sthlm_69@xxxx> wrote:
> > > I meant to say...does "anyone" know how to code this one.
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "sthlm_69" <sthlm_69@xxxx> 
> wrote:
> > > > I checked in the AFL library and surprisingly nobody has 
> posted this
> > > > code. Its a common indicator and should be in the library - 
> does any
> > > > know how to code this one ? 10 days u/d ratios is what I have 
> seen.
> > > >
> > > > Thanks!
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 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 other support material please check also:
> > > http://www.amibroker.com/support.html
> > > 
> > > 
> > > Yahoo! Groups Links
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > -- 
> > Cheers
> > Graham
> > http://e-wire.net.au/~eb_kavan/




------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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 other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/