QuantConnect/Lean · error · ValueError
Regression test failed: current bid price was not loaded fro
Error message
Regression test failed: current bid price was not loaded from FOXA file and is not $0.05
What it means
Companion assertion in the same OptionRenameRegressionAlgorithm, run on 2013-07-02 after 14:00. After the symbol has been renamed to FOXA (Twenty-First Century Fox), it checks contract.bid_price equals exactly 0.05 for the same CALL (strike 33, expiry 2013-08-17). Failure means the post-rename data file (FOXA) did not load the expected bid price, indicating a data-mapping, regression-data, or float-equality problem.
Source
Thrown at Algorithm.Python/OptionRenameRegressionAlgorithm.py:69
# Buy the undelying stock
underlying_symbol = contract.symbol.underlying
self.buy (underlying_symbol, 100)
# check
if float(contract.ask_price) != 1.1:
raise ValueError("Regression test failed: current ask price was not loaded from NWSA backtest file and is not $1.1")
elif self.time.day == 2 and self.time.hour > 14 and self.time.minute > 0:
for kvp in slice.option_chains:
chain = kvp.value
self.liquidate()
contracts = [i for i in sorted(chain, key=lambda x:x.expiry)
if i.right == OptionRight.CALL and
i.strike == 33 and
i.expiry.date() == datetime(2013,8,17).date()]
if contracts:
contract = contracts[0]
self.log("Bid Price" + str(contract.bid_price))
if float(contract.bid_price) != 0.05:
raise ValueError("Regression test failed: current bid price was not loaded from FOXA file and is not $0.05")
def on_order_event(self, order_event):
self.log(str(order_event))
View on GitHub (pinned to d2c3659f87)
Solutions
- Verify the FOXA regression data file bid value; if intentionally changed, update the golden 0.05 constant.
- Check the FOXA map/factor files under Lean/Data for correctness and that the rename resolver picks the FOXA file on 2013-07-02.
- Switch exact equality to a tolerance: abs(bid - 0.05) < 1e-6.
- Confirm the liquidate() call did not alter the contract object's cached quote before the read.
Example fix
// before
if float(contract.bid_price) != 0.05:
raise ValueError('...not $0.05')
// after
if abs(float(contract.bid_price) - 0.05) > 1e-6:
raise ValueError(f'bid price {contract.bid_price} != 0.05 from FOXA data') Defensive patterns
Strategy: validation
Validate before calling
# Tolerance-based bid check for the post-rename FOXA data
BID_GOLDEN = 0.05
if abs(float(contract.bid_price) - BID_GOLDEN) > 1e-6:
raise ValueError(f'FOXA bid {contract.bid_price} != {BID_GOLDEN}') Prevention
- Use tolerance, not exact equality, for price assertions.
- Keep FOXA map/factor files aligned with the regression data package.
- Re-verify golden constants whenever data zips are regenerated.
- Confirm the rename resolver selects the FOXA file on the post-rename date.
When it happens
Trigger: On day 2 after 14:00, after self.liquidate(), selecting the CALL strike 33 / 2013-08-17 contract and reading contract.bid_price when it is not float-equal to 0.05. Triggered by regenerated data zips, edited FOXA map files, or changed symbol-mapping resolution.
Common situations: Regenerating Lean regression data; modifying the FOXA/TFCFA map or factor files; a rounding change in bid-price normalization so 0.05 is stored as a near-but-not-equal double.
Related errors
- Regression test failed: current ask price was not loaded fro
- Index is not tradable.
- Trade volume should be greater than zero by the end of this
- Indicators are not ready!
- Expiry event was not at the correct time, {orderEvent.UtcTim
AI-assisted analysis of QuantConnect/Lean@d2c3659f87 (2026-08-13).
Data as JSON: /api/errors/f675a90ba008b896.
Report an issue: GitHub.