kieran-mackle / AutoTrader

A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.

Home Page:https://kieran-mackle.github.io/AutoTrader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to access across different price data in Strategy

ktlim86 opened this issue · comments

Hi,

I was looking at the documentation and I have a use case where I want to compare across different price asset in term of their volatility and rank them accordingly. May I know does Autotrader support this?
Thank you.

Hi @ktlim86,

I am assuming you are asking how to get the prices of multiple assets into a single strategy? If so, the main thing to look for is to set PORTFOLIO: True in the strategy configuration. This will indicate to autotrader that all of the instruments in your WATCHLIST are to be passed into a single strategy bot, rather than to spawn a single bot for each.

After setting PORTFOLIO: True, the data passed to your strategy will contain the prices for all of the instruments in your watchlist.

Does this help?

hi @kieran-mackle ,

that mean if i will to access the data, it will be data["EURUSD=X"] and data["GPBUSD=X"] if i will to assess EURUSD and GBPUSD asset in the generate_signal function? so if i want to do the multi-timeframe, does it mean i can further access by data["EURUSD=X"]["1h] and data["EURUSD=X"]["1d"]?
Thank you.

@ktlim86

Yes, it should be something like that, however I would now recommend simply resampling the data to your desired timeframe(s) from the base data passed in.