Hi to all
I am new to R and I would like to test the scenario that it is mentioned to
this paper "Tsang, William Wai Him and Chong, Terence Tai Leung, (2009),
Profitability of the On-Balance Volume Indicator, Economics Bulletin, 29,
issue 3, p. 2424-2431."

The trading rule examined in the paper is the crossover of OBV and its
 simple 20-day moving average (OBVMA).

Trading Rule
Buy at day t: OBVt-1 < OBVMAt-1 and OBVt > OBVMAt
Buy at day t: OBVt-1 > OBVMAt-1 and OBVt < OBVMAt
long position is taken when OBV rises above its 20-day moving average, and
the position is
liquidated once OBV drops below the 20-day OBVMA .

So far i managed to write a few lines for the script of this trading rule
because just i said above i am new to R
Here are the commands
require(quantmod)
getSymbols("GEK.AT", from="2006-01-01")
obv <- OBV(Cl(GEK.AT), Vo(GEK.AT))
obvma.20 <- SMA(obv, n=20)

I would like to help me to write the commands
1)for the trade rule,
2)to show up the plots of the obv and the obvma in the same graph and
3)the outcome of this trade rule.

Thanks in advance

	[[alternative HTML version deleted]]

