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

[amibroker] Re: Trading the Positivity of Volume - An Indicator



PureBytes Links

Trading Reference Links

Thanks for posting your trading system.  I have generalized and 
refactored it a bit to allow you to specify any periods instead of 10 
and 12.  I tried it in daytrading on 1 minute bars, and found that 13 
and 16 worked better, but still no profit for me.

Also included is a handy utility ("Let") to switch variable settings 
between assignment, Param, and Optimize modes. 

// Positivity of Volume, by Gerard Carey
// Generalized by Daniel LaLiberte

function PositivityOfVolume (prd1, prd2)
{
	aWMA = WMA(Close, prd1);
	vWMA = WMA(Volume, prd1);
	cond = Iif(aWMA > Ref(aWMA, -1), vWMA, -vWMA);

	CA = cond - Ref(MA(cond, prd2), -1);
	return CA;
}

function Let(label, default, start, end, inc, mode)
// Arguments are the same as Param and Optimize, 
// with additional mode argument to specify either
// assignment ("i"), Param ("p"), or Optimize ("o")
{
	if (mode == "i") result = default;
	else if (mode == "p") result = 
		Param(label, default, start, end, inc);
	else if (mode == "o") result = 
		Optimize(label, default, start, end, inc);

	return result;
}
prd1 = Let("prd1", 10, 9, 15, 1, "o"); 
prd2 = Let("prd2", 12, 15, 26, 1, "i");

PoV = PositivityOfVolume(prd1, prd2);

Plot(PoV, "Positivity of Volume", colorBlack, styleThick);
Plot(0, "", colorRed);








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/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/