Skip to content

Assertion failed: (result.start_value() > 0) #2

@somethingbloodyfunky

Description

@somethingbloodyfunky

Hi Peter,

This is an extremely well-designed library and I'd love to use it. However, I'm having trouble downloading BTC/USD as given in the intro page since http://bitcoincharts.com is no longer live. This means that I'm not sure about the data format you're expecting. I tried using market_data.ipynb to get SPY data via,

bazel run :convert -- \  
--input_price_history_csv_file="/$(pwd)/data/SPY.csv" \ 
--output_price_history_delimited_proto_file="/$(pwd)/data/SPY.dpb" \
--start_time="1990-01-01" \
--end_time="2024-12-13"

which appears to run OK

Selected time period:
[1990-01-01 00:00:00 - 2024-12-13 00:00:00)
Reading price history from CSV file: //Volumes/Storage/Code/trader-backtest/data/SPY.csv
Loaded 8026 records in 0.014 seconds
Top 50 gaps:
729475200 [1993-02-12 00:00:00] - 729820800 [1993-02-16 00:00:00]: 96:00:00
...
1351209600 [2012-10-26 00:00:00] - 1351641600 [2012-10-31 00:00:00]: 120:00:00
Writing 8026 records to the file: //Volumes/Storage/Code/trader-backtest/data/SPY.dpb

But when I run

bazel run :trader -- \
  --input_ohlc_history_delimited_proto_file="/$(pwd)/data/SPY.dpb" \
  --trader="rebalancing" \
  --start_time="2017-01-01" \
  --end_time="2022-01-01" \
  --evaluation_period_months=6 \
  --start_base_balance=1.0 \
  --start_quote_balance=0.0

I get Assertion failed: (result.start_value() > 0) but I'm not sure what that means in this case. Here's the complete output.

Trader AccountConfig:
start_base_balance: 1
start_quote_balance: 0
base_unit: 1e-05
quote_unit: 0.01
market_order_fee_config {
  relative_fee: 0.005
  fixed_fee: 0
  minimum_fee: 0
}
stop_order_fee_config {
  relative_fee: 0.005
  fixed_fee: 0
  minimum_fee: 0
}
limit_order_fee_config {
  relative_fee: 0.005
  fixed_fee: 0
  minimum_fee: 0
}
market_liquidity: 0.5
max_volume_ratio: 0.5

Selected time period:
[2017-01-01 00:00:00 - 2022-01-01 00:00:00)

Trader EvaluationConfig:
start_timestamp_sec: 1483228800
end_timestamp_sec: 1640995200
evaluation_period_months: 6

Reading OHLC history from: //Volumes/Storage/Code/trader-backtest/data/SPY.dpb
- Loaded 8026 records in 0.004 seconds
- Selected 1259 records within the time period: [2017-01-01 00:00:00 - 2022-01-01 00:00:00)

rebalancing-trader[0.700|0.050] evaluation:
Assertion failed: (result.start_value() > 0), function EvaluateTrader, file eval.cc, line 177.
[1]    77183 abort      bazel run :trader --  --trader="rebalancing" --start_time="2017-01-01"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions