Hi Arthur,
All your weights/allocations whether at single asset strategy level or at portfolio level have to be in the 0 to 1 range. It is not possible to short, even in a single asset strategy, during this Alphathon.
However, your performance will be assessed against a benchmark (BB refence is “MEUDa”). When you want to be “short”, you can just have a 0 allocation. By definition, the benchmark is always “long” (it has a weight of 1 at all times). If you have a 0 allocation while the benchmark is 1, you are “under-exposed” to the market. You can check this by trying these lines of code in AlphienStudio:
We take the benchmark BB between 2007 and 2010:
> bench = getLyxorBBs(‘MEUDa’, asPrice = T)[‘2007::2010’]
Then, we design a simple momentum payout: when returns over one week and returns over two weeks have both been negative, we decide the momentum is negative and we want to be under-exposed (0 weight):
> underExposurePayout = function(price){
-
retOneWeek = ROC(price, 5, type='discrete')
-
retTwoWeek = ROC(price, 10, type='discrete')
-
signal = ifelse(retOneWeek<0.0&retTwoWeek<0.0, 0, 1)
-
return(signal)
- }
You can compute your allocations and run a backtest:
> strat = underExposurePayout(bench)
> backtest(bench, strat)
Check out the results. You have over-performed the benchmark over the period by being under-exposed or “short” relative to the benchmark.
Please let us know if this makes sense or if you have follow-up questions!