[INFO] cloning repository https://github.com/sssemil/backtest_rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/sssemil/backtest_rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsssemil%2Fbacktest_rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsssemil%2Fbacktest_rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] fb4fa774943f8b48d62c2169b3cbe6e7ed55338c [INFO] checking sssemil/backtest_rs against try#8d46be77cd48fdbcced888d027457e2c9cf2aa16 for pr-142723 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsssemil%2Fbacktest_rs" "/workspace/builds/worker-5-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/sssemil/backtest_rs on toolchain 8d46be77cd48fdbcced888d027457e2c9cf2aa16 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+8d46be77cd48fdbcced888d027457e2c9cf2aa16" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/sssemil/backtest_rs [INFO] finished tweaking git repo https://github.com/sssemil/backtest_rs [INFO] tweaked toml for git repo https://github.com/sssemil/backtest_rs written to /workspace/builds/worker-5-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/sssemil/backtest_rs already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+8d46be77cd48fdbcced888d027457e2c9cf2aa16" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:90999bfc7ae267e83380e433d8e61a7c072ca6729e92edbae886d3423b3a6f4c" "/opt/rustwide/cargo-home/bin/cargo" "+8d46be77cd48fdbcced888d027457e2c9cf2aa16" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 3a9b1bbd8723962cc596e3d6bb6c379e671f161a8897141f6778e3e4e8dd0da4 [INFO] running `Command { std: "docker" "start" "-a" "3a9b1bbd8723962cc596e3d6bb6c379e671f161a8897141f6778e3e4e8dd0da4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "3a9b1bbd8723962cc596e3d6bb6c379e671f161a8897141f6778e3e4e8dd0da4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3a9b1bbd8723962cc596e3d6bb6c379e671f161a8897141f6778e3e4e8dd0da4", kill_on_drop: false }` [INFO] [stdout] 3a9b1bbd8723962cc596e3d6bb6c379e671f161a8897141f6778e3e4e8dd0da4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:90999bfc7ae267e83380e433d8e61a7c072ca6729e92edbae886d3423b3a6f4c" "/opt/rustwide/cargo-home/bin/cargo" "+8d46be77cd48fdbcced888d027457e2c9cf2aa16" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] c3b1d122b28dc3ef3ef77f633e420901b01d9747f81322e12eae330b40c5d92d [INFO] running `Command { std: "docker" "start" "-a" "c3b1d122b28dc3ef3ef77f633e420901b01d9747f81322e12eae330b40c5d92d", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.93 [INFO] [stderr] Compiling unicode-ident v1.0.17 [INFO] [stderr] Compiling autocfg v1.4.0 [INFO] [stderr] Checking cfg-if v1.0.0 [INFO] [stderr] Compiling libm v0.2.11 [INFO] [stderr] Compiling libc v0.2.169 [INFO] [stderr] Checking once_cell v1.20.3 [INFO] [stderr] Checking byteorder v1.5.0 [INFO] [stderr] Compiling serde v1.0.218 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Compiling paste v1.0.15 [INFO] [stderr] Checking bytemuck v1.21.0 [INFO] [stderr] Checking itoa v1.0.14 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling matrixmultiply v0.3.9 [INFO] [stderr] Compiling typenum v1.18.0 [INFO] [stderr] Compiling serde_json v1.0.139 [INFO] [stderr] Checking safe_arch v0.7.4 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Checking ryu v1.0.19 [INFO] [stderr] Checking wide v0.7.32 [INFO] [stderr] Checking lazy_static v1.5.0 [INFO] [stderr] Checking rawpointer v0.2.1 [INFO] [stderr] Compiling quote v1.0.38 [INFO] [stderr] Compiling anyhow v1.0.96 [INFO] [stderr] Compiling thiserror v1.0.69 [INFO] [stderr] Compiling syn v2.0.98 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking crossbeam-epoch v0.9.18 [INFO] [stderr] Checking csv-core v0.1.12 [INFO] [stderr] Checking thread_local v1.1.8 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking either v1.13.0 [INFO] [stderr] Compiling rayon-core v1.12.1 [INFO] [stderr] Checking iana-time-zone v0.1.61 [INFO] [stderr] Checking approx v0.5.1 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Checking crossbeam-deque v0.8.6 [INFO] [stderr] Checking chrono v0.4.39 [INFO] [stderr] Checking half v2.4.1 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Compiling getrandom v0.3.1 [INFO] [stderr] Compiling rustix v0.38.44 [INFO] [stderr] Checking clap_lex v0.7.4 [INFO] [stderr] Checking simba v0.6.0 [INFO] [stderr] Checking plotters-backend v0.3.7 [INFO] [stderr] Checking ciborium-io v0.2.2 [INFO] [stderr] Checking regex-syntax v0.8.5 [INFO] [stderr] Checking anstyle v1.0.10 [INFO] [stderr] Checking plotters-svg v0.3.7 [INFO] [stderr] Checking clap_builder v4.5.30 [INFO] [stderr] Checking ciborium-ll v0.2.2 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking cast v0.3.0 [INFO] [stderr] Checking bitflags v2.8.0 [INFO] [stderr] Checking same-file v1.0.6 [INFO] [stderr] Checking linux-raw-sys v0.4.15 [INFO] [stderr] Checking walkdir v2.5.0 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking criterion-plot v0.5.0 [INFO] [stderr] Checking plotters v0.3.7 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking clap v4.5.30 [INFO] [stderr] Checking is-terminal v0.4.15 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Checking anes v0.1.6 [INFO] [stderr] Checking fastrand v2.3.0 [INFO] [stderr] Checking oorandom v11.1.4 [INFO] [stderr] Checking overload v0.1.1 [INFO] [stderr] Checking log v0.4.26 [INFO] [stderr] Checking nu-ansi-term v0.46.0 [INFO] [stderr] Checking sharded-slab v0.1.7 [INFO] [stderr] Checking tracing-log v0.2.0 [INFO] [stderr] Checking pin-project-lite v0.2.16 [INFO] [stderr] Checking smallvec v1.14.0 [INFO] [stderr] Compiling test-case-core v3.3.1 [INFO] [stderr] Checking tracing-subscriber v0.3.19 [INFO] [stderr] Compiling nalgebra-macros v0.1.0 [INFO] [stderr] Checking tempfile v3.17.1 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling serde_derive v1.0.218 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling tracing-attributes v0.1.28 [INFO] [stderr] Compiling test-case-macros v3.3.1 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking test-case v3.3.1 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking rand_distr v0.4.3 [INFO] [stderr] Checking nalgebra v0.29.0 [INFO] [stderr] Checking csv v1.3.1 [INFO] [stderr] Checking ciborium v0.2.2 [INFO] [stderr] Checking tinytemplate v1.2.1 [INFO] [stderr] Checking criterion v0.5.1 [INFO] [stderr] Checking statrs v0.16.1 [INFO] [stderr] Checking backtest v0.1.0 (/opt/rustwide/workdir/crates/backtest) [INFO] [stdout] error[E0432]: unresolved import `crate::portfolio::PortfolioMetrics` [INFO] [stdout] --> crates/backtest/src/report/mod.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | use crate::portfolio::PortfolioMetrics; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `PortfolioMetrics` in `portfolio` [INFO] [stdout] | [INFO] [stdout] help: consider importing this struct through its public re-export instead [INFO] [stdout] | [INFO] [stdout] 13 - use crate::portfolio::PortfolioMetrics; [INFO] [stdout] 13 + use crate::analysis::PortfolioMetrics; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0432]: unresolved import `crate::utils::stats::TradeStats` [INFO] [stdout] --> crates/backtest/src/report/mod.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | use crate::utils::stats::TradeStats; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TradeStats` in `utils::stats` [INFO] [stdout] | [INFO] [stdout] help: consider importing this struct through its public re-export instead [INFO] [stdout] | [INFO] [stdout] 14 - use crate::utils::stats::TradeStats; [INFO] [stdout] 14 + use crate::analysis::TradeStats; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0432]: unresolved import `crate::portfolio::PortfolioMetrics` [INFO] [stdout] --> crates/backtest/src/report/mod.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | use crate::portfolio::PortfolioMetrics; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `PortfolioMetrics` in `portfolio` [INFO] [stdout] | [INFO] [stdout] help: consider importing this struct through its public re-export instead [INFO] [stdout] | [INFO] [stdout] 13 - use crate::portfolio::PortfolioMetrics; [INFO] [stdout] 13 + use crate::analysis::PortfolioMetrics; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0432]: unresolved import `crate::utils::stats::TradeStats` [INFO] [stdout] --> crates/backtest/src/report/mod.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | use crate::utils::stats::TradeStats; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TradeStats` in `utils::stats` [INFO] [stdout] | [INFO] [stdout] help: consider importing this struct through its public re-export instead [INFO] [stdout] | [INFO] [stdout] 14 - use crate::utils::stats::TradeStats; [INFO] [stdout] 14 + use crate::analysis::TradeStats; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `market::Price` [INFO] [stdout] --> crates/backtest/src/analysis/technical.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | market::Price, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Deserialize` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:5:24 [INFO] [stdout] | [INFO] [stdout] 5 | use serde::{Serialize, Deserialize}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::market::Price` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::market::Price; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `market::Price` [INFO] [stdout] --> crates/backtest/src/analysis/technical.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | market::Price, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Deserialize` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:5:24 [INFO] [stdout] | [INFO] [stdout] 5 | use serde::{Serialize, Deserialize}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::market::Price` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::market::Price; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::market::Price` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | use crate::market::Price; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0053]: method `get_depth` has an incompatible type for trait [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:243:48 [INFO] [stdout] | [INFO] [stdout] 243 | fn get_depth(&self, _levels: usize) -> OrderBookDepth { [INFO] [stdout] | ^^^^^^^^^^^^^^ expected `std::option::Option`, found `OrderBookDepth` [INFO] [stdout] | [INFO] [stdout] note: type in trait [INFO] [stdout] --> crates/backtest/src/market/simulator.rs:12:43 [INFO] [stdout] | [INFO] [stdout] 12 | fn get_depth(&self, levels: usize) -> Option; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = note: expected signature `fn(&MockMarket, _) -> std::option::Option` [INFO] [stdout] found signature `fn(&MockMarket, _) -> OrderBookDepth` [INFO] [stdout] help: change the output type to match the trait [INFO] [stdout] | [INFO] [stdout] 243 - fn get_depth(&self, _levels: usize) -> OrderBookDepth { [INFO] [stdout] 243 + fn get_depth(&self, _levels: usize) -> std::option::Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `Candle` has no field named `trade_count` [INFO] [stdout] --> crates/backtest/src/analysis/test_utils.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | trade_count: 1, [INFO] [stdout] | ^^^^^^^^^^^ `Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `Candle` has no field named `value` [INFO] [stdout] --> crates/backtest/src/analysis/test_utils.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | value: close, [INFO] [stdout] | ^^^^^ `Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:323:51 [INFO] [stdout] | [INFO] [stdout] 323 | let position = Position::new(symbol, 1.0, Price::new(100.0), 2.0); [INFO] [stdout] | ------------- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this function are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: associated function defined here [INFO] [stdout] --> crates/backtest/src/execution/position.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn new(symbol: Symbol, size: f64, entry_price: Price, leverage: f64) -> Self { [INFO] [stdout] | ^^^ ------------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 323 | let position = Position::new(symbol, 1.0, Price::new(100.0).expect("REASON"), 2.0); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: arguments to this method are incorrect [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:326:17 [INFO] [stdout] | [INFO] [stdout] 326 | metrics.update(&position, Price::new(99.0), Price::new(110.0)); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: expected `Price`, found `Option` [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:326:35 [INFO] [stdout] | [INFO] [stdout] 326 | metrics.update(&position, Price::new(99.0), Price::new(110.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: expected `Price`, found `Option` [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:326:53 [INFO] [stdout] | [INFO] [stdout] 326 | metrics.update(&position, Price::new(99.0), Price::new(110.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn update(&mut self, position: &Position, intended_entry: Price, intended_exit: Price) { [INFO] [stdout] | ^^^^^^ --------------------- -------------------- [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 326 | metrics.update(&position, Price::new(99.0).expect("REASON"), Price::new(110.0)); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 326 | metrics.update(&position, Price::new(99.0), Price::new(110.0).expect("REASON")); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:410:50 [INFO] [stdout] | [INFO] [stdout] 410 | Position::new(symbol.clone(), 600.0, Price::new(100.0), 1.0), [INFO] [stdout] | ------------- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this function are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: associated function defined here [INFO] [stdout] --> crates/backtest/src/execution/position.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn new(symbol: Symbol, size: f64, entry_price: Price, leverage: f64) -> Self { [INFO] [stdout] | ^^^ ------------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 410 | Position::new(symbol.clone(), 600.0, Price::new(100.0).expect("REASON"), 1.0), [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/analysis/metrics.rs:411:50 [INFO] [stdout] | [INFO] [stdout] 411 | Position::new(symbol.clone(), 400.0, Price::new(100.0), 1.0), [INFO] [stdout] | ------------- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this function are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: associated function defined here [INFO] [stdout] --> crates/backtest/src/execution/position.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn new(symbol: Symbol, size: f64, entry_price: Price, leverage: f64) -> Self { [INFO] [stdout] | ^^^ ------------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 411 | Position::new(symbol.clone(), 400.0, Price::new(100.0).expect("REASON"), 1.0), [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 80 | return Err("Invalid trade data".into()); [INFO] [stdout] | ---- type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: cannot satisfy `_: From<&str>` [INFO] [stdout] = note: required for `&str` to implement `Into<_>` [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `vwap` [INFO] [stdout] --> crates/backtest/src/analysis/technical.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | vwap: 100.0, [INFO] [stdout] | ^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `trade_count` [INFO] [stdout] --> crates/backtest/src/analysis/test_utils.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | trade_count: 1, [INFO] [stdout] | ^^^^^^^^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `value` [INFO] [stdout] --> crates/backtest/src/analysis/test_utils.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | value: close, [INFO] [stdout] | ^^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 72 | .map_err(|e| format!("Invalid volume: {}", e))?; [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From` found in the following crates: `alloc`, `serde_json`, `std`: [INFO] [stdout] - impl From for Arc; [INFO] [stdout] - impl From for Box; [INFO] [stdout] - impl From for OsString; [INFO] [stdout] - impl From for PathBuf; [INFO] [stdout] - impl From for Rc; [INFO] [stdout] - impl From for Value; [INFO] [stdout] - impl From for Vec; [INFO] [stdout] - impl From for std::thread::thread_name_string::ThreadNameString; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 68 | .map_err(|e| format!("Invalid price: {}", e))?; [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From` found in the following crates: `alloc`, `serde_json`, `std`: [INFO] [stdout] - impl From for Arc; [INFO] [stdout] - impl From for Box; [INFO] [stdout] - impl From for OsString; [INFO] [stdout] - impl From for PathBuf; [INFO] [stdout] - impl From for Rc; [INFO] [stdout] - impl From for Value; [INFO] [stdout] - impl From for Vec; [INFO] [stdout] - impl From for std::thread::thread_name_string::ThreadNameString; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 64 | .map_err(|e| format!("Invalid timestamp: {}", e))?; [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From` found in the following crates: `alloc`, `serde_json`, `std`: [INFO] [stdout] - impl From for Arc; [INFO] [stdout] - impl From for Box; [INFO] [stdout] - impl From for OsString; [INFO] [stdout] - impl From for PathBuf; [INFO] [stdout] - impl From for Rc; [INFO] [stdout] - impl From for Value; [INFO] [stdout] - impl From for Vec; [INFO] [stdout] - impl From for std::thread::thread_name_string::ThreadNameString; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 80 | return Err("Invalid trade data".into()); [INFO] [stdout] | ---- type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: [INFO] [stdout] - impl From<&'static str> for clap::Id; [INFO] [stdout] - impl From<&'static str> for clap::builder::OsStr; [INFO] [stdout] - impl From<&'static str> for clap::builder::Str; [INFO] [stdout] - impl From<&'static str> for clap::builder::StyledStr; [INFO] [stdout] = note: required for `&str` to implement `Into<_>` [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 76 | .ok_or("Invalid side")?; [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: [INFO] [stdout] - impl From<&'static str> for clap::Id; [INFO] [stdout] - impl From<&'static str> for clap::builder::OsStr; [INFO] [stdout] - impl From<&'static str> for clap::builder::Str; [INFO] [stdout] - impl From<&'static str> for clap::builder::StyledStr; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 74 | let side = record.get(3).ok_or("Missing side")?; [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: [INFO] [stdout] - impl From<&'static str> for clap::Id; [INFO] [stdout] - impl From<&'static str> for clap::builder::OsStr; [INFO] [stdout] - impl From<&'static str> for clap::builder::Str; [INFO] [stdout] - impl From<&'static str> for clap::builder::StyledStr; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 70 | let volume = record.get(2).ok_or("Missing volume")? [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: [INFO] [stdout] - impl From<&'static str> for clap::Id; [INFO] [stdout] - impl From<&'static str> for clap::builder::OsStr; [INFO] [stdout] - impl From<&'static str> for clap::builder::Str; [INFO] [stdout] - impl From<&'static str> for clap::builder::StyledStr; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `clone` found for struct `OrderBook` in the current scope [INFO] [stdout] --> crates/backtest/src/market/simulator.rs:55:40 [INFO] [stdout] | [INFO] [stdout] 55 | let mut book = self.order_book.clone(); [INFO] [stdout] | ^^^^^ method not found in `OrderBook` [INFO] [stdout] | [INFO] [stdout] ::: crates/backtest/src/market/orderbook.rs:24:1 [INFO] [stdout] | [INFO] [stdout] 24 | pub struct OrderBook { [INFO] [stdout] | -------------------- method `clone` not found for this struct [INFO] [stdout] | [INFO] [stdout] = help: items from traits can only be used if the trait is implemented and in scope [INFO] [stdout] = note: the following trait defines an item `clone`, perhaps you need to implement it: [INFO] [stdout] candidate #1: `Clone` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 66 | let price = record.get(1).ok_or("Missing price")? [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: [INFO] [stdout] - impl From<&'static str> for clap::Id; [INFO] [stdout] - impl From<&'static str> for clap::builder::OsStr; [INFO] [stdout] - impl From<&'static str> for clap::builder::Str; [INFO] [stdout] - impl From<&'static str> for clap::builder::StyledStr; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0283]: type annotations needed [INFO] [stdout] --> crates/backtest/src/data/source.rs:86:38 [INFO] [stdout] | [INFO] [stdout] 62 | let timestamp = record.get(0).ok_or("Missing timestamp")? [INFO] [stdout] | - type must be known at this point [INFO] [stdout] ... [INFO] [stdout] 86 | Some(result.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: multiple `impl`s satisfying `_: From<&str>` found in the `clap_builder` crate: [INFO] [stdout] - impl From<&'static str> for clap::Id; [INFO] [stdout] - impl From<&'static str> for clap::builder::OsStr; [INFO] [stdout] - impl From<&'static str> for clap::builder::Str; [INFO] [stdout] - impl From<&'static str> for clap::builder::StyledStr; [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 86 | Some(result.map_err(|e: /* Type */| io::Error::new(io::ErrorKind::InvalidData, e).into())) [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0609]: no field `timestamp` on type `&PortfolioMetrics` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:162:26 [INFO] [stdout] | [INFO] [stdout] 162 | timestamp: m.timestamp, [INFO] [stdout] | ^^^^^^^^^ unknown field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `beta`, `sharpe_ratio`, `sortino_ratio`, `diversity_score`, `exposure_ratios`, `concentration_risk` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0609]: no field `total_equity` on type `&PortfolioMetrics` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:163:22 [INFO] [stdout] | [INFO] [stdout] 163 | value: m.total_equity, [INFO] [stdout] | ^^^^^^^^^^^^ unknown field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `beta`, `sharpe_ratio`, `sortino_ratio`, `diversity_score`, `exposure_ratios`, `concentration_risk` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `entry_time` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:184:29 [INFO] [stdout] | [INFO] [stdout] 184 | chart.add_trade(pos.entry_time(), pos.entry_price(), pos.is_long()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: there is a method `entry_price` with a similar name [INFO] [stdout] | [INFO] [stdout] 184 - chart.add_trade(pos.entry_time(), pos.entry_price(), pos.is_long()); [INFO] [stdout] 184 + chart.add_trade(pos.entry_price(), pos.entry_price(), pos.is_long()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:184:43 [INFO] [stdout] | [INFO] [stdout] 184 | chart.add_trade(pos.entry_time(), pos.entry_price(), pos.is_long()); [INFO] [stdout] | --------- ^^^^^^^^^^^^^^^^^ expected `f64`, found `Price` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | pub fn add_trade(&mut self, timestamp: f64, price: f64, is_buy: bool) { [INFO] [stdout] | ^^^^^^^^^ ---------- [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `exit_price` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:185:33 [INFO] [stdout] | [INFO] [stdout] 185 | if let Some(exit) = pos.exit_price() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: there is a method `last_price` with a similar name [INFO] [stdout] | [INFO] [stdout] 185 - if let Some(exit) = pos.exit_price() { [INFO] [stdout] 185 + if let Some(exit) = pos.last_price() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `exit_time` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:186:33 [INFO] [stdout] | [INFO] [stdout] 186 | chart.add_trade(pos.exit_time().unwrap_or(pos.entry_time()), exit, !pos.is_long()); [INFO] [stdout] | ^^^^^^^^^ method not found in `&position::Position` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `entry_time` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:186:59 [INFO] [stdout] | [INFO] [stdout] 186 | chart.add_trade(pos.exit_time().unwrap_or(pos.entry_time()), exit, !pos.is_long()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: there is a method `entry_price` with a similar name [INFO] [stdout] | [INFO] [stdout] 186 - chart.add_trade(pos.exit_time().unwrap_or(pos.entry_time()), exit, !pos.is_long()); [INFO] [stdout] 186 + chart.add_trade(pos.exit_time().unwrap_or(pos.entry_price()), exit, !pos.is_long()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:109:70 [INFO] [stdout] | [INFO] [stdout] 109 | let current_price = market.current_price().unwrap_or_else(|| Price::new(0.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | [INFO] [stdout] = note: expected struct `Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 109 | let current_price = market.current_price().unwrap_or_else(|| Price::new(0.0).expect("REASON")); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `clone` found for struct `orderbook::OrderBook` in the current scope [INFO] [stdout] --> crates/backtest/src/market/simulator.rs:55:40 [INFO] [stdout] | [INFO] [stdout] 55 | let mut book = self.order_book.clone(); [INFO] [stdout] | ^^^^^ method not found in `orderbook::OrderBook` [INFO] [stdout] | [INFO] [stdout] ::: crates/backtest/src/market/orderbook.rs:24:1 [INFO] [stdout] | [INFO] [stdout] 24 | pub struct OrderBook { [INFO] [stdout] | -------------------- method `clone` not found for this struct [INFO] [stdout] | [INFO] [stdout] = help: items from traits can only be used if the trait is implemented and in scope [INFO] [stdout] = note: the following trait defines an item `clone`, perhaps you need to implement it: [INFO] [stdout] candidate #1: `Clone` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0609]: no field `timestamp` on type `&metrics::PortfolioMetrics` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:162:26 [INFO] [stdout] | [INFO] [stdout] 162 | timestamp: m.timestamp, [INFO] [stdout] | ^^^^^^^^^ unknown field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `beta`, `sharpe_ratio`, `sortino_ratio`, `diversity_score`, `exposure_ratios`, `concentration_risk` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0609]: no field `total_equity` on type `&metrics::PortfolioMetrics` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:163:22 [INFO] [stdout] | [INFO] [stdout] 163 | value: m.total_equity, [INFO] [stdout] | ^^^^^^^^^^^^ unknown field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `beta`, `sharpe_ratio`, `sortino_ratio`, `diversity_score`, `exposure_ratios`, `concentration_risk` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `entry_time` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:184:29 [INFO] [stdout] | [INFO] [stdout] 184 | chart.add_trade(pos.entry_time(), pos.entry_price(), pos.is_long()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: there is a method `entry_price` with a similar name [INFO] [stdout] | [INFO] [stdout] 184 - chart.add_trade(pos.entry_time(), pos.entry_price(), pos.is_long()); [INFO] [stdout] 184 + chart.add_trade(pos.entry_price(), pos.entry_price(), pos.is_long()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:184:43 [INFO] [stdout] | [INFO] [stdout] 184 | chart.add_trade(pos.entry_time(), pos.entry_price(), pos.is_long()); [INFO] [stdout] | --------- ^^^^^^^^^^^^^^^^^ expected `f64`, found `Price` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | pub fn add_trade(&mut self, timestamp: f64, price: f64, is_buy: bool) { [INFO] [stdout] | ^^^^^^^^^ ---------- [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `exit_price` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:185:33 [INFO] [stdout] | [INFO] [stdout] 185 | if let Some(exit) = pos.exit_price() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: there is a method `last_price` with a similar name [INFO] [stdout] | [INFO] [stdout] 185 - if let Some(exit) = pos.exit_price() { [INFO] [stdout] 185 + if let Some(exit) = pos.last_price() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `exit_time` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:186:33 [INFO] [stdout] | [INFO] [stdout] 186 | chart.add_trade(pos.exit_time().unwrap_or(pos.entry_time()), exit, !pos.is_long()); [INFO] [stdout] | ^^^^^^^^^ method not found in `&position::Position` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `entry_time` found for reference `&position::Position` in the current scope [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:186:59 [INFO] [stdout] | [INFO] [stdout] 186 | chart.add_trade(pos.exit_time().unwrap_or(pos.entry_time()), exit, !pos.is_long()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: there is a method `entry_price` with a similar name [INFO] [stdout] | [INFO] [stdout] 186 - chart.add_trade(pos.exit_time().unwrap_or(pos.entry_time()), exit, !pos.is_long()); [INFO] [stdout] 186 + chart.add_trade(pos.exit_time().unwrap_or(pos.entry_price()), exit, !pos.is_long()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `trade_count` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | trade_count: 10, [INFO] [stdout] | ^^^^^^^^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `value` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:218:13 [INFO] [stdout] | [INFO] [stdout] 218 | value: 1000.0, [INFO] [stdout] | ^^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `trade_count` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:245:13 [INFO] [stdout] | [INFO] [stdout] 245 | trade_count: 10, [INFO] [stdout] | ^^^^^^^^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0560]: struct `candle::Candle` has no field named `value` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:246:13 [INFO] [stdout] | [INFO] [stdout] 246 | value: 1000.0, [INFO] [stdout] | ^^^^^ `candle::Candle` does not have this field [INFO] [stdout] | [INFO] [stdout] = note: available fields are: `trades`, `buy_volume`, `sell_volume` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:125:31 [INFO] [stdout] | [INFO] [stdout] 125 | .with_entry_price(price) [INFO] [stdout] | ---------------- ^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | pub fn with_entry_price(mut self, price: Price) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ ------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 125 | .with_entry_price(price.expect("REASON")) [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:126:29 [INFO] [stdout] | [INFO] [stdout] 126 | .with_stop_loss(Price::new(95.0)) [INFO] [stdout] | -------------- ^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:85:12 [INFO] [stdout] | [INFO] [stdout] 85 | pub fn with_stop_loss(mut self, price: Price) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ ------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 126 | .with_stop_loss(Price::new(95.0).expect("REASON")) [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:127:31 [INFO] [stdout] | [INFO] [stdout] 127 | .with_take_profit(Price::new(110.0)); [INFO] [stdout] | ---------------- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:91:12 [INFO] [stdout] | [INFO] [stdout] 91 | pub fn with_take_profit(mut self, price: Price) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ ------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 127 | .with_take_profit(Price::new(110.0).expect("REASON")); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:132:49 [INFO] [stdout] | [INFO] [stdout] 132 | assert_eq!(signal.entry_price.unwrap(), price); [INFO] [stdout] | ^^^^^ expected `Price`, found `Option` [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 132 | assert_eq!(signal.entry_price.unwrap(), price.expect("REASON")); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:109:70 [INFO] [stdout] | [INFO] [stdout] 109 | let current_price = market.current_price().unwrap_or_else(|| Price::new(0.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 109 | let current_price = market.current_price().unwrap_or_else(|| Price::new(0.0).expect("REASON")); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:233:37 [INFO] [stdout] | [INFO] [stdout] 233 | current_price: Some(Price::new(100.0)), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this enum variant are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] help: the type constructed contains `std::option::Option` due to the type of the argument passed [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:233:32 [INFO] [stdout] | [INFO] [stdout] 233 | current_price: Some(Price::new(100.0)), [INFO] [stdout] | ^^^^^-----------------^ [INFO] [stdout] | | [INFO] [stdout] | this argument influences the type of `Some` [INFO] [stdout] note: tuple variant defined here [INFO] [stdout] --> /rustc/8d46be77cd48fdbcced888d027457e2c9cf2aa16/library/core/src/option.rs:599:5 [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 233 | current_price: Some(Price::new(100.0).expect("REASON")), [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `options` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:96:51 [INFO] [stdout] | [INFO] [stdout] 96 | fn write_csv(&self, writer: &mut W, options: &ChartOptions) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0599]: no function or associated item named `new` found for struct `OrderBookDepth` in the current scope [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:244:29 [INFO] [stdout] | [INFO] [stdout] 244 | OrderBookDepth::new() [INFO] [stdout] | ^^^ function or associated item not found in `OrderBookDepth` [INFO] [stdout] | [INFO] [stdout] ::: crates/backtest/src/market/orderbook.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | pub struct OrderBookDepth { [INFO] [stdout] | ------------------------- function or associated item `new` not found for this struct [INFO] [stdout] | [INFO] [stdout] = help: items from traits can only be used if the trait is implemented and in scope [INFO] [stdout] = note: the following traits define an item `new`, perhaps you need to implement one of them: [INFO] [stdout] candidate #1: `UniformSampler` [INFO] [stdout] candidate #2: `criterion::stats::tuple::TupledDistributionsBuilder` [INFO] [stdout] candidate #3: `plotters::style::font::FontData` [INFO] [stdout] candidate #4: `typenum::marker_traits::Bit` [INFO] [stdout] help: there is a method `ne` with a similar name, but with different arguments [INFO] [stdout] --> /rustc/8d46be77cd48fdbcced888d027457e2c9cf2aa16/library/core/src/cmp.rs:263:5 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `options` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:117:52 [INFO] [stdout] | [INFO] [stdout] 117 | fn write_json(&self, writer: &mut W, options: &ChartOptions) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `options` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:128:59 [INFO] [stdout] | [INFO] [stdout] 128 | fn write_tradingview(&self, writer: &mut W, options: &ChartOptions) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:274:31 [INFO] [stdout] | [INFO] [stdout] 274 | .with_entry_price(Price::new(100.0)) [INFO] [stdout] | ---------------- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | pub fn with_entry_price(mut self, price: Price) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ ------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 274 | .with_entry_price(Price::new(100.0).expect("REASON")) [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0283, E0308, E0432, E0560, E0599, E0609. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0283`. [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:275:29 [INFO] [stdout] | [INFO] [stdout] 275 | .with_stop_loss(Price::new(95.0)); [INFO] [stdout] | -------------- ^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this method are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: method defined here [INFO] [stdout] --> crates/backtest/src/strategy/signal.rs:85:12 [INFO] [stdout] | [INFO] [stdout] 85 | pub fn with_stop_loss(mut self, price: Price) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ ------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 275 | .with_stop_loss(Price::new(95.0).expect("REASON")); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> crates/backtest/src/strategy/mod.rs:294:73 [INFO] [stdout] | [INFO] [stdout] 294 | let position = Position::new(Symbol("TEST".to_string()), 600.0, Price::new(100.0), 1.0); [INFO] [stdout] | ------------- ^^^^^^^^^^^^^^^^^ expected `Price`, found `Option` [INFO] [stdout] | | [INFO] [stdout] | arguments to this function are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected struct `price::Price` [INFO] [stdout] found enum `std::option::Option` [INFO] [stdout] note: associated function defined here [INFO] [stdout] --> crates/backtest/src/execution/position.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn new(symbol: Symbol, size: f64, entry_price: Price, leverage: f64) -> Self { [INFO] [stdout] | ^^^ ------------------ [INFO] [stdout] help: consider using `Option::expect` to unwrap the `std::option::Option` value, panicking if the value is an `Option::None` [INFO] [stdout] | [INFO] [stdout] 294 | let position = Position::new(Symbol("TEST".to_string()), 600.0, Price::new(100.0).expect("REASON"), 1.0); [INFO] [stdout] | +++++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `backtest` (lib) due to 17 previous errors; 6 warnings emitted [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] warning: unused variable: `options` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:96:51 [INFO] [stdout] | [INFO] [stdout] 96 | fn write_csv(&self, writer: &mut W, options: &ChartOptions) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `options` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:117:52 [INFO] [stdout] | [INFO] [stdout] 117 | fn write_json(&self, writer: &mut W, options: &ChartOptions) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `options` [INFO] [stdout] --> crates/backtest/src/report/visualization.rs:128:59 [INFO] [stdout] | [INFO] [stdout] 128 | fn write_tradingview(&self, writer: &mut W, options: &ChartOptions) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0053, E0283, E0308, E0432, E0560, E0599, E0609. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0053`. [INFO] [stdout] [INFO] [stderr] error: could not compile `backtest` (lib test) due to 38 previous errors; 7 warnings emitted [INFO] running `Command { std: "docker" "inspect" "c3b1d122b28dc3ef3ef77f633e420901b01d9747f81322e12eae330b40c5d92d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c3b1d122b28dc3ef3ef77f633e420901b01d9747f81322e12eae330b40c5d92d", kill_on_drop: false }` [INFO] [stdout] c3b1d122b28dc3ef3ef77f633e420901b01d9747f81322e12eae330b40c5d92d