AutoTrader icon indicating copy to clipboard operation
AutoTrader copied to clipboard

Ability to access across different price data in Strategy

Open ktlim86 opened this issue 1 year ago • 2 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.

ktlim86 avatar Sep 18 '22 12:09 ktlim86

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?

kieran-mackle avatar Sep 18 '22 22:09 kieran-mackle

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 avatar Sep 19 '22 02:09 ktlim86

@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.

kieran-mackle avatar Oct 26 '22 23:10 kieran-mackle