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

[amibroker] Standard deviation of Intraday average volume



PureBytes Links

Trading Reference Links

Hi,

I downloaded this code from the Amibroker AFL library which calculates the intraday average volume. I have been trying to calculate the standard deviation of volume for the same time of day, however after messing around with it for quite some time I still haven't managed to code anything that gives the correct answer.

Can someone please help?

Many thanks.


Avgvol=0;
if (Interval()<inDaily) {
	n = round(3600*6.75/Interval());  //number of bars in the day
	d = Param("Lookback days",5,1,30,1); //averaging period
	barnum = BarsSince(Day()!=Ref(Day(),-1)); //bar number from start of the day
	for (i=0; i<n; i++) {
		VarSet("vol"+i,IIf(i==barnum,V,0));
	}
	for (i=0; i<n; i++) { 
		Avgvol=IIf(barnum==i,Sum(VarGet("vol"+i),n*d)/d,Avgvol);
	}

}




------------------------------------

**** 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

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/