Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
More Dynamic PositionConcentration Constraints Tuned To Alpha

Hello,
Is anyone aware of a way for Optimize API to provide more dynamic upper/lower bounds for position concentrations in a hedged algorithm?

Instead of position size constraints like this:
[ max=0.01 / min=-0.01 ]

I think it could be very beneficial to have something like more like this:
[ maxLong=0.01 / minLong=0.001 / maxShort=0.01 / minShort=0.001 ]

The goal is to maintain a larger breadth of bets in hopes of smoothing out the returns by letting Optimize API determine a proportional weighting relative to the alpha signal.

Is this possible?
Thank you

1 response

Look at the 'PositionConcentration' constraint. https://www.quantopian.com/help#module-quantopian_optimize_constraints It allows for explicitly setting the minimum and maximum concentration for each asset. One could set the maximum percent proportional to the alpha for each asset.


# Assume the alphas are in a series already. First will need to normalize them.  
weights = alphas / alphas.sum()

# However, this will probably create too great a restriction.  
# To give optimize some 'wiggle room' perhaps multiply by constant  
weights = weights * MY_WIGGLE_ROOM

# Then simply use this in the PositionConcentration constraint  
max_position_constraint  = opt.PositionConcentration(min_weights = -weights,  max_weights = weights)