Heerozh / spectre

GPU-accelerated Factors analysis library and Backtester
GNU General Public License v3.0
627 stars 108 forks source link

how to calculate rolling factors #13

Closed sherryhooo closed 3 years ago

sherryhooo commented 3 years ago

hi, heerozh, I am not not familiar with PyTorch, could you help me with calculating factors like Average close prices over 4-weeks divided by average close prices over 52-weeks? Do I need define a new function in your spectre.parallel.Rolling class? Thanks a lot

Heerozh commented 3 years ago

hi, heerozh, I am not not familiar with PyTorch, could you help me with calculating factors like Average close prices over 4-weeks divided by average close prices over 52-weeks? Do I need define a new function in your spectre.parallel.Rolling class? Thanks a lot

engine.add(factors.MA(20) / factors.MA(260), 'name')