Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILD.bazed
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ setup(
"requests",
"tqdm",
"plotly",
"grpcio==1.70.0",
"protobuf==5.29.1",
"grpcio==1.74.0",
"protobuf==6.31.1",
],
# platforms=["win_amd64"],
)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

- CLI + upcoming UI

[![indicator plot](/static/indicator_banner.png)](/examples/python/main.py)

## Quick Links

- [Home](https://qpace.dev)
Expand Down
2 changes: 1 addition & 1 deletion cli/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Profile {
public async ping(): Promise<void> {
const client = await this.getClient();
try {
await client.me();
await client.user.me();
} catch (e) {
if (axios.isAxiosError(e) && e.response?.status == 403) {
throw new CliError(
Expand Down
2 changes: 1 addition & 1 deletion cli/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getCommands = (): Command[] => {
profile.data.apiKey = apiKey;
const client = await profile.getClient(false);
try {
const user = await client.me();
const user = await client.user.me();
verbose &&
console.log(
`${QPACE_BG_PREFIX}Logged in as ${chalk.yellowBright(
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "qpace_core"
version = "0.2.6"
version = "0.2.7"
edition = "2021"

[lib]
Expand Down
79 changes: 66 additions & 13 deletions core/backtest.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use chrono::{DateTime, Utc};

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / publish

unused imports: `DateTime` and `Utc`

Check warning on line 1 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / publish

unused imports: `DateTime` and `Utc`

use crate::{
ctx::{Ctx, CtxSkip},
legacy::Float64Utils,
metrics::{
avg_losing_trade, avg_trade, avg_win_loss_ratio, avg_winning_trade, gross_loss_pct,
gross_profit_pct, net_profit_pct, profit_factor, sharpe_ratio_from_returns,
sortino_ratio_from_returns, win_rate,
annualization_factor, avg_losing_trade, avg_trade, avg_win_loss_ratio, avg_winning_trade,
expectancy, gross_loss_pct, gross_profit_pct, net_profit_pct, profit_factor,
sharpe_ratio_from_returns, sortino_ratio_from_returns, win_rate,
},
orderbook::{
order_size_for_equity_pct, round_contracts, round_to_min_tick, validate_contracts,
Expand All @@ -12,7 +14,8 @@
},
signal::{Signal, SignalKind},
stats::returns,
sym::Sym,

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / publish

unused imports: `sym::Sym` and `timeframe::Timeframe`

Check warning on line 17 in core/backtest.rs

View workflow job for this annotation

GitHub Actions / publish

unused imports: `sym::Sym`, `timeframe::Timeframe`, and `utils::with_suffix`
timeframe::Timeframe,
trade::{Trade, TradeError, TradeEvent},
utils::with_suffix,
};
Expand All @@ -37,6 +40,8 @@
initial_capital: f64,
process_orders_on_close: bool,
debug: bool,
risk_free_rate: f64,
annualization_factor: f64,
}

impl Default for BacktestConfig {
Expand All @@ -45,6 +50,8 @@
initial_capital: 1000.0,
process_orders_on_close: false,
debug: false,
risk_free_rate: f64::NAN,
annualization_factor: f64::NAN,
}
}
}
Expand All @@ -55,6 +62,8 @@
initial_capital,
process_orders_on_close,
debug: false,
risk_free_rate: f64::NAN,
annualization_factor: f64::NAN,
};
}

Expand Down Expand Up @@ -87,6 +96,16 @@
pub fn set_debug(&mut self, debug: bool) {
self.debug = debug;
}

#[inline]
pub fn set_risk_free_rate(&mut self, risk_free_rate: f64) {
self.risk_free_rate = risk_free_rate;
}

#[inline]
pub fn set_annualization_factor(&mut self, annualization_factor: f64) {
self.annualization_factor = annualization_factor;
}
}

pub struct Backtest {
Expand Down Expand Up @@ -117,12 +136,19 @@

impl Backtest {
#[inline]
pub fn new(ctx: Rc<RefCell<Ctx>>, config: BacktestConfig) -> Self {
pub fn new(ctx: Rc<RefCell<Ctx>>, mut config: BacktestConfig) -> Self {
let sym = ctx.borrow().sym().clone();
assert!(
!f64::is_nan(sym.min_qty()) && !f64::is_nan(sym.min_tick()),
"Ctx Symbol is not suitable for backtesting, min_qty is NaN or min_tick is NaN"
);
if config.risk_free_rate.is_nan() {
config.risk_free_rate = 0.0;
}
if config.annualization_factor.is_nan() {
config.annualization_factor =
annualization_factor(ctx.borrow().ohlcv().timeframe(), sym.kind().trading_days());
}
let initial_capital = config.initial_capital;
Self {
ctx,
Expand Down Expand Up @@ -273,13 +299,20 @@
}

#[inline]
pub fn sharpe_ratio(&self, rfr: f64) -> f64 {
sharpe_ratio_from_returns(&self.returns_list(), rfr)
pub fn sharpe_ratio(&self) -> f64 {
sharpe_ratio_from_returns(&self.returns_list(), self.config.risk_free_rate)
* self.config.annualization_factor
}

#[inline]
pub fn sortino_ratio(&self, rfr: f64) -> f64 {
sortino_ratio_from_returns(&self.returns_list(), rfr)
pub fn sortino_ratio(&self) -> f64 {
sortino_ratio_from_returns(&self.returns_list(), self.config.risk_free_rate)
* self.config.annualization_factor
}

#[inline]
pub fn expectancy(&self) -> f64 {
expectancy(&self.pnl_list())
}

#[inline]
Expand Down Expand Up @@ -411,8 +444,18 @@
return trade;
}

// @TODO
// pub fn maybe_reset_equity_pct(&mut self) {
// if self.position_size() == 0.0 {
// self.prev_equity_pct = 0.0;
// }
// }

pub fn compute_equity_pct(&mut self, equity_pct: f64) -> Option<OrderConfig> {
let ctx = self.ctx.borrow();
// if self.bar_index() == 21454 || self.bar_index() == 21293 {
// println!("[{} -> compute_equity_pct]: equity(): {:?} | equity_pct: {:?} | prev_equity_pct: {:?} ", self.bar_index(), self.equity(), equity_pct, self.prev_equity_pct);
// }
if self.equity() > 0.0 {
if !equity_pct.compare(self.prev_equity_pct) {
// if true {
Expand All @@ -429,7 +472,7 @@
let order_size =
round_contracts(base_order_size, ctx.sym().min_qty(), ctx.sym().qty_scale());

// if self.config.debug {
// if self.bar_index() == 21454 || self.bar_index() == 21293 {
// println!("[{} -> compute_equity_pct]: equity_pct: {:?} | prev_equity_pct: {:?} | base_order_size: {:?} | order_size: {:?} | min_qty: {:?} | price_scale: {:?}", self.bar_index(), equity_pct, self.prev_equity_pct, base_order_size, order_size, ctx.sym().min_qty(), ctx.sym().price_scale());
// }

Expand Down Expand Up @@ -656,10 +699,16 @@

#[inline]
pub fn signal(&mut self, signal: Signal) {
// if self.config.debug {
// println!("[{} ->raw signal]: {:?}", self.bar_index(), &signal);
// }
let order: Option<OrderConfig> = match signal.kind() {
SignalKind::EquityPct(pct) => self.compute_equity_pct(*pct),
SignalKind::Size(size) => Some(OrderConfig::new(*size, None)),
SignalKind::CloseAll() => Some(OrderConfig::new(-self.position_size, None)),
SignalKind::CloseAll() => {
self.prev_equity_pct = 0.0;
Some(OrderConfig::new(-self.position_size, None))
}
_ => None,
};
if self.config.debug {
Expand Down Expand Up @@ -801,7 +850,6 @@

#[cfg(feature = "pretty_table")]
pub fn print_table(&self) {
let rfr = 0.0;
let sym = self.ctx.borrow().sym().clone();
let f_price = with_suffix(&format!(" {}", sym._currency()));
let f_percent = with_suffix("%");
Expand Down Expand Up @@ -830,12 +878,12 @@

table.add_row(Row::from(vec![
Cell::new("Sharpe Ratio"),
Cell::new(format!("{:0.3}", self.sharpe_ratio(rfr))),
Cell::new(format!("{:0.3}", self.sharpe_ratio())),
]));

table.add_row(Row::from(vec![
Cell::new("Sortino Ratio"),
Cell::new(format!("{:0.3}", self.sortino_ratio(rfr))),
Cell::new(format!("{:0.3}", self.sortino_ratio())),
]));

table.add_row(Row::from(vec![
Expand Down Expand Up @@ -888,6 +936,11 @@
Cell::new(f_raw(self.avg_win_loss_ratio())),
]));

table.add_row(Row::from(vec![
Cell::new("Expectancy"),
Cell::new(f_raw(self.expectancy())),
]));

// Print the table
println!("{}", table);
}
Expand Down
18 changes: 14 additions & 4 deletions core/backtest_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
trade_node::NodeTrade,
};
use napi::bindgen_prelude::*;
use napi::Result;

Check warning on line 8 in core/backtest_node.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused import: `napi::Result`

Check warning on line 8 in core/backtest_node.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused import: `napi::Result`

Check warning on line 8 in core/backtest_node.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused import: `napi::Result`

Check warning on line 8 in core/backtest_node.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused import: `napi::Result`

Check warning on line 8 in core/backtest_node.rs

View workflow job for this annotation

GitHub Actions / publish

unused import: `napi::Result`
use napi_derive::napi;
use std::{cell::RefCell, rc::Rc};

Expand All @@ -31,12 +31,16 @@
ctx: &NodeCtx,
initial_capital: Option<f64>,
process_orders_on_close: Option<bool>,
risk_free_rate: Option<f64>,
annualization_factor: Option<f64>,
) -> Self {
let initial_capital = initial_capital.unwrap_or(1000.0);
let process_orders_on_close = process_orders_on_close.unwrap_or(false);
let mut config = BacktestConfig::default();
config.set_initial_capital(initial_capital);
config.set_process_orders_on_close(process_orders_on_close);
config.set_risk_free_rate(risk_free_rate.unwrap_or(f64::NAN));
config.set_annualization_factor(annualization_factor.unwrap_or(f64::NAN));
Self {
inner: Rc::new(RefCell::new(Backtest::new(ctx.inner().clone(), config))),
ctx: ctx.clone(),
Expand Down Expand Up @@ -177,14 +181,20 @@

#[napi(js_name = "sharpeRatio")]
#[inline]
pub fn node_sharpe_ratio(&self, rfr: f64) -> f64 {
self.inner.borrow().sharpe_ratio(rfr)
pub fn node_sharpe_ratio(&self) -> f64 {
self.inner.borrow().sharpe_ratio()
}

#[napi(js_name = "sortinoRatio")]
#[inline]
pub fn node_sortino_ratio(&self, rfr: f64) -> f64 {
self.inner.borrow().sortino_ratio(rfr)
pub fn node_sortino_ratio(&self) -> f64 {
self.inner.borrow().sortino_ratio()
}

#[napi(js_name = "expectancy")]
#[inline]
pub fn node_expectancy(&self) -> f64 {
self.inner.borrow().expectancy()
}

#[napi(js_name = winningTradesCount)]
Expand Down
20 changes: 15 additions & 5 deletions core/backtest_py.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,23 @@ impl PyBacktest {
#[gen_stub_pymethods]
#[pymethods]
impl PyBacktest {
#[pyo3(signature = (ctx, initial_capital=1000.0, process_orders_on_close=false, debug=false))]
#[pyo3(signature = (ctx, initial_capital=1000.0, process_orders_on_close=false, debug=false, risk_free_rate=None, annualization_factor=None))]
#[new]
#[inline]
pub fn py_new(
ctx: PyCtx,
initial_capital: f64,
process_orders_on_close: bool,
debug: bool,
risk_free_rate: Option<f64>,
annualization_factor: Option<f64>,
) -> Self {
let mut config = BacktestConfig::default();
config.set_initial_capital(initial_capital);
config.set_process_orders_on_close(process_orders_on_close);
config.set_debug(debug);
config.set_risk_free_rate(risk_free_rate.unwrap_or(f64::NAN));
config.set_annualization_factor(annualization_factor.unwrap_or(f64::NAN));
Self {
inner: Rc::new(RefCell::new(Backtest::new(ctx.inner().clone(), config))),
ctx,
Expand Down Expand Up @@ -183,14 +187,20 @@ impl PyBacktest {

#[pyo3(name = "sharpe_ratio")]
#[inline]
pub fn py_sharpe_ratio(&self, rfr: f64) -> f64 {
self.inner.borrow().sharpe_ratio(rfr)
pub fn py_sharpe_ratio(&self) -> f64 {
self.inner.borrow().sharpe_ratio()
}

#[pyo3(name = "sortino_ratio")]
#[inline]
pub fn py_sortino_ratio(&self, rfr: f64) -> f64 {
self.inner.borrow().sortino_ratio(rfr)
pub fn py_sortino_ratio(&self) -> f64 {
self.inner.borrow().sortino_ratio()
}

#[pyo3(name = "expectancy")]
#[inline]
pub fn py_expectancy(&self) -> f64 {
self.inner.borrow().expectancy()
}

#[getter(position_size)]
Expand Down
18 changes: 14 additions & 4 deletions core/backtest_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ impl WasmBacktest {
ctx: WasmCtx,
initial_capital: Option<f64>,
process_orders_on_close: Option<bool>,
risk_free_rate: Option<f64>,
annualization_factor: Option<f64>,
) -> Self {
let initial_capital = initial_capital.unwrap_or(1000.0);
let process_orders_on_close = process_orders_on_close.unwrap_or(false);
let mut config = BacktestConfig::default();
config.set_initial_capital(initial_capital);
config.set_process_orders_on_close(process_orders_on_close);
config.set_risk_free_rate(risk_free_rate.unwrap_or(f64::NAN));
config.set_annualization_factor(annualization_factor.unwrap_or(f64::NAN));
Self {
inner: Rc::new(RefCell::new(Backtest::new(ctx.inner().clone(), config))),
ctx,
Expand Down Expand Up @@ -188,14 +192,20 @@ impl WasmBacktest {

#[wasm_bindgen(js_name = "sharpeRatio")]
#[inline]
pub fn wasm_sharpe_ratio(&self, rfr: f64) -> f64 {
self.inner.borrow().sharpe_ratio(rfr)
pub fn wasm_sharpe_ratio(&self) -> f64 {
self.inner.borrow().sharpe_ratio()
}

#[wasm_bindgen(js_name = "sortinoRatio")]
#[inline]
pub fn wasm_sortino_ratio(&self, rfr: f64) -> f64 {
self.inner.borrow().sortino_ratio(rfr)
pub fn wasm_sortino_ratio(&self) -> f64 {
self.inner.borrow().sortino_ratio()
}

#[wasm_bindgen(js_name = "expectancy")]
#[inline]
pub fn wasm_expectancy(&self) -> f64 {
self.inner.borrow().expectancy()
}

#[wasm_bindgen(getter = winningTradesCount)]
Expand Down
1 change: 1 addition & 0 deletions core/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
extern crate polars;

#[cfg(feature = "bindings_node")]
#[macro_use]

Check warning on line 5 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused `#[macro_use]` import

Check warning on line 5 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused `#[macro_use]` import

Check warning on line 5 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused `#[macro_use]` import

Check warning on line 5 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused `#[macro_use]` import

Check warning on line 5 in core/lib.rs

View workflow job for this annotation

GitHub Actions / publish

unused `#[macro_use]` import
extern crate napi_derive;

#[cfg(feature = "bindings_node")]
use napi::bindgen_prelude::*;

Check warning on line 9 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused import: `napi::bindgen_prelude::*`

Check warning on line 9 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused import: `napi::bindgen_prelude::*`

Check warning on line 9 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused import: `napi::bindgen_prelude::*`

Check warning on line 9 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused import: `napi::bindgen_prelude::*`

Check warning on line 9 in core/lib.rs

View workflow job for this annotation

GitHub Actions / publish

unused import: `napi::bindgen_prelude::*`
#[cfg(feature = "bindings_node")]
use napi_derive::napi;

Expand All @@ -29,18 +29,18 @@
pub mod timeframe;
pub mod trade;
pub mod utils;
use trade::{Trade, TradeDirection, TradeEvent};

Check warning on line 32 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused imports: `TradeDirection`, `TradeEvent`, and `Trade`

Check warning on line 32 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused imports: `TradeDirection`, `TradeEvent`, and `Trade`

Check warning on line 32 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused imports: `TradeDirection`, `TradeEvent`, and `Trade`

Check warning on line 32 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused imports: `TradeDirection`, `TradeEvent`, and `Trade`

Check warning on line 32 in core/lib.rs

View workflow job for this annotation

GitHub Actions / publish

unused imports: `TradeDirection`, `TradeEvent`, and `Trade`

cfg_if::cfg_if! { if #[cfg(feature = "bindings_py")] {
extern crate pyo3;
use pyo3::prelude::*;

Check warning on line 36 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused import: `pyo3::prelude::*`

Check warning on line 36 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused import: `pyo3::prelude::*`

Check warning on line 36 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused import: `pyo3::prelude::*`

Check warning on line 36 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused import: `pyo3::prelude::*`
use pyo3::{
pyfunction, pymodule,
types::{PyModule, PyModuleMethods},
wrap_pyfunction, Bound, PyResult,
};
use pyo3::{wrap_pymodule};

Check warning on line 42 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused import: `wrap_pymodule`

Check warning on line 42 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused import: `wrap_pymodule`

Check warning on line 42 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused import: `wrap_pymodule`

Check warning on line 42 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused import: `wrap_pymodule`
use pyo3_stub_gen::{define_stub_info_gatherer, derive::gen_stub_pyfunction};

Check warning on line 43 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-24.04, linux-x64-gnu)

unused import: `derive::gen_stub_pyfunction`

Check warning on line 43 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-14, aarch64-apple-darwin)

unused import: `derive::gen_stub_pyfunction`

Check warning on line 43 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-13, x86_64-apple-darwin)

unused import: `derive::gen_stub_pyfunction`

Check warning on line 43 in core/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win32-x64-msvc)

unused import: `derive::gen_stub_pyfunction`
pub mod timeframe_py;
pub mod sym_py;
pub mod stats_py;
Expand Down Expand Up @@ -146,6 +146,7 @@
m.add_function(wrap_pyfunction!(metrics_py::py_precision, m)?)?;
m.add_function(wrap_pyfunction!(metrics_py::py_recall, m)?)?;
m.add_function(wrap_pyfunction!(metrics_py::py_f1, m)?)?;
m.add_function(wrap_pyfunction!(metrics_py::py_annualization_factor, m)?)?;
Ok(())
}
define_stub_info_gatherer!(stub_info);
Expand Down
Loading
Loading