Expected Behavior
The following algorithm populates the Forex Session with all of the daily bars in the history request.
class DancingApricotBarracuda(QCAlgorithm):
def initialize(self):
self.set_start_date(2024, 9, 25)
self.set_cash(100_000)
forex = self.add_forex("EURUSD")
lookback = 152
forex.session.size = lookback
bars = self.history[QuoteBar](forex, lookback, Resolution.DAILY)
for bar in bars:
forex.session.update(bar)
self.quit(f'bars: {len(list(bars))}; session.samples: {forex.session.samples}')
Actual Behavior
Quit(): bars: 152; session.samples: 77
However, if we use set_warm_up instead, it populates correctly.
class DancingApricotBarracuda(QCAlgorithm):
def initialize(self):
self.set_start_date(2024, 9, 25)
self.set_cash(100_000)
self._forex = self.add_forex("EURUSD")
lookback = 152
self._forex.session.size = lookback
self.set_warm_up(lookback, Resolution.DAILY)
def on_warmup_finished(self):
self.quit(f'session.samples: {self._forex.session.samples}')
Quit(): session.samples: 154
Potential Solution
N/A
Reproducing the Problem
Run the algorithm above.
System Information
QC Cloud
Checklist
Expected Behavior
The following algorithm populates the Forex Session with all of the daily bars in the history request.
Actual Behavior
However, if we use
set_warm_upinstead, it populates correctly.Potential Solution
N/A
Reproducing the Problem
Run the algorithm above.
System Information
QC Cloud
Checklist
masterbranch