edtechre / pybroker

Algorithmic Trading in Python with Machine Learning

Home Page:https://www.pybroker.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi-timeframe?

tsunamilx opened this issue · comments

A simple example: I need 2 indicators, one from daily time frame, another from weekly time frame, when the daily one is above the weekly one, enter long position, when the daily one is below the weekly one, exit long position.

Is it possible? Any suggestions?

Thanks.

Hi @tsunamilx,

I would suggest creating an indicator that repeats the weekly value for every day of the week. You could also do this by adding a column to your data frame that does the weekly calculation and registering it with PyBroker.

In either case you would then execute a strategy on daily data, and perform the check between your weekly indicator/column and daily indicator.

Thanks, this is actually what I started to do.