Hello, 

 

Maybe I am missing something in the docs, but how do I perform a calculation or computation with close prices from two different timeframes? I have already consolidated the data for the 4H timeframe and have a rolling window setup that is being updated in the OnData() and the OnDataConsolidated() methods. I will add the code to this when I get to my computer if that is helpful but for now- maybe the below is enough for somebody smarter than me. 

 

EG: 

asset1 = Daily Timeframe

asset2 = 4H Timeframe

asset1_return = (asset1_price[0].Close - asset1_price[1].Close) * 100 / asset1_price[1].Close

asset2_return (asset2_price[0].Close - asset2_price[1].Close) * 100 / asset2_price[1].Close

delta = asset1_return - asset2_return

I am assuming (possibly incorrectly) that I need to perform these in the OnDataConsolidated() method but QC will not let me access the asset2 data because it is a different timeframe. 

 

I tried to access the asset1 data in the OnData() method but it also gave me an error. 

 

 

 

Author