Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Using quantiles in w/Optimize?

I've been using Alphalens to tune my algo, and my short/long strategy is based on quantiles. How would I go about using these with the Optimize API? For example, only consider the quantile (0) for short positions and quantile (1) for long positions.

Thanks

edit:
It appears I might want to use these within the constraints?

class LongOnly(asset_or_assets, max_error_display=10)

Constraint for assets that cannot be held in short positions.  
Parameters: asset_or_assets (Asset or iterable[Asset]) -- The asset(s) that must be long or zero.

class ShortOnly(asset_or_assets, max_error_display=10)

Constraint for assets that cannot be held in long positions.  
Parameters: asset_or_assets (Asset or iterable[Asset]) -- The asset(s) that must be short or zero.