Sample Algo (VWAP) with variable short/long volumes

hi all, i just tested out something interesting with the sample algo. In the sample algo:

'''if price < vwap * 0.995 and notional > context.min_notional:
order(context.aapl,-100)'''

'''elif price > vwap * 1.005 and notional < context.max_notional:
order(context.aapl,+100)'''


I was thinking, if we could track the overall trend of the stock/market, why don't we place "weights" on the long and short volumes, for example, if the trend is predicted to go upwards, we distribute a higher proportion to the long stock and a lesser proportion to the short stock volume. i ran the backtest for 3 years (2008-2011) and got a 170% return for shorting 100 and longing 300.

Anyone has any inputs to implement this "tracker"? I am thinking of ARMA modelling with estimation (i came from an electrical engineering and signal processing background)

cheers all