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

How to use IndicatorSet with Strategy?

Pirat83 opened this issue · comments

Hello,

I have red https://www.pybroker.com/en/latest/notebooks/5.%20Writing%20Indicators.html#Computing-Multiple-Indicators and https://www.pybroker.com/en/latest/_modules/pybroker/indicator.html#IndicatorsMixin but I can not figure out how to use the IndicatorSet with pybroker's Strategy?

I am able to add and remove the Indicators to / from the IndicatorSet but I don't know where the 'DataFramementioned in the documentation cames from and how to use it inside aStrategy`?

Also I would like to calculate Indicators on dedicated symbols not on all. Is this possible?

Could you please give me a hint? Thank you very much.

Hi Pirate83,

The IndicatorSet is only intended to be used to generate a DataFrame. If you wish, you can use data from that DataFrame with a Strategy. Otherwise, it is recommended you declare your indicators with pybroker.indicator.

Indicators are only computed on the symbols that you specify to use on a strategy execution. You can add multiple executions on a strategy with different symbols and indicators. See Strategy#add_execution.