Hi again, I have tried make Louis code multi symbol in the backtest attached, but with my poor coding skills, I am stuck.
I have a list of symbols in “UserVar” and I am storing a bunch of information for each in a dictionary of symbolData objects that is created in the Initialize() method and access every 4H in the OnData() block when data is consolidated.
Problem #1: In the Initialize() block, I also call the “AddData<FundingRate>” method for each symbol in my list. The main issue is that at the moment the “source” in the "FundingRate" class is static and set to BTC “https://ftx.com/api/funding_rates?future=BTC-PERP”; I would need to pass “symbolData.BaseSymbol” to be used instead of “BTC” for each symbol, but I don't know how to do that.
Problem #2: I need to figure out how to retrieve the FundingRate data for each symbol so I can update “symbolData.FundingRate”. Maybe I also have to store the FundingRate objects for each symbol into a dictionary, but it might be there is a more efficient way to do that.
I can probably figure out #2 by myself, but would appreciate any help with #1 (QCC bounty on offer 😊).