alpacahq / pipeline-live

Pipeline Extension for Live Trading
https://pypi.org/project/pipeline-live/
Apache License 2.0
205 stars 56 forks source link

Using Mask to speed up execution. #20

Closed ikosenn closed 4 years ago

ikosenn commented 4 years ago

I have a pipeline that has a complex CustomFactor. I am trying to reduce the time it takes to run by using a mask but the mask always has True values. i.e. It doesn't filter out values. The total stocks I start with are ~8000 but if the mask works, my Custom Factor should only execute on about 200. That will increase performance. I am more than happy to implement this if you can point me in the right direction.

Example:



def make_pipeline():
    rsi = RSI()
    custom = CustomFactor(mask=(rsi > 70)) # should ideally provide a subset to run on
    return Pipeline({
        'column': columns
    })