Skip to content

Commit

Permalink
refactor: refactor the visibility of the fee models.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaz001 committed Aug 4, 2024
1 parent eb5f02f commit bfb4447
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion hftbacktest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hftbacktest"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["nkaz001 <[email protected]>"]
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion hftbacktest/examples/gridtrading_backtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ use hftbacktest::{
assettype::LinearAsset,
data::{read_npz_file, DataSource},
models::{
fee::{CommonFees, TradingValueFeeModel},
CommonFees,
IntpOrderLatency,
PowerProbQueueFunc3,
ProbQueueModel,
TradingValueFeeModel,
},
recorder::BacktestRecorder,
AssetBuilder,
Expand Down
3 changes: 2 additions & 1 deletion hftbacktest/examples/gridtrading_backtest_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use hftbacktest::{
assettype::LinearAsset,
data::read_npz_file,
models::{
fee::{CommonFees, TradingValueFeeModel},
CommonFees,
IntpOrderLatency,
PowerProbQueueFunc3,
ProbQueueModel,
TradingValueFeeModel,
},
recorder::BacktestRecorder,
AssetBuilder,
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, io::Error as IoError, marker::PhantomData};

pub use data::DataSource;
use data::{Cache, Reader};
use models::fee::FeeModel;
use models::FeeModel;
use thiserror::Error;

use crate::{
Expand Down
10 changes: 9 additions & 1 deletion hftbacktest/src/backtest/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
//! Please find more details in the documents below.
//! * [Latency Models](https://hftbacktest.readthedocs.io/en/latest/latency_models.html)
//! * [Order Fill](https://hftbacktest.readthedocs.io/en/latest/order_fill.html)
pub mod fee;
mod fee;
mod latency;
mod queue;

pub use fee::{
CommonFees,
DirectionalFees,
FeeModel,
FlatPerTradeFeeModel,
TradingQtyFeeModel,
TradingValueFeeModel,
};
pub use latency::{ConstantLatency, IntpOrderLatency, LatencyModel, OrderLatencyRow};
#[cfg(any(feature = "unstable_l3", doc))]
pub use queue::{L3FIFOQueueModel, L3OrderId, L3OrderSource, L3QueueModel};
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/proc/l3_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
backtest::{
assettype::AssetType,
data::{Data, Reader},
models::{fee::FeeModel, LatencyModel},
models::{FeeModel, LatencyModel},
order::OrderBus,
proc::{LocalProcessor, Processor},
state::State,
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/proc/l3_nopartialfillexchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
assettype::AssetType,
data::{Data, Reader},
models::{
fee::FeeModel,
FeeModel,
L3FIFOQueueModel,
L3OrderId,
L3OrderSource,
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/proc/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
backtest::{
assettype::AssetType,
data::{Data, Reader},
models::{fee::FeeModel, LatencyModel},
models::{FeeModel, LatencyModel},
order::OrderBus,
proc::{LocalProcessor, Processor},
state::State,
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/proc/nopartialfillexchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
backtest::{
assettype::AssetType,
data::{Data, Reader},
models::{fee::FeeModel, LatencyModel, QueueModel},
models::{FeeModel, LatencyModel, QueueModel},
order::OrderBus,
proc::Processor,
state::State,
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/proc/partialfillexchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
backtest::{
assettype::AssetType,
data::{Data, Reader},
models::{fee::FeeModel, LatencyModel, QueueModel},
models::{FeeModel, LatencyModel, QueueModel},
order::OrderBus,
proc::Processor,
state::State,
Expand Down
2 changes: 1 addition & 1 deletion hftbacktest/src/backtest/state.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
backtest::{assettype::AssetType, models::fee::FeeModel},
backtest::{assettype::AssetType, models::FeeModel},
types::{Order, StateValues},
};

Expand Down
5 changes: 4 additions & 1 deletion py-hftbacktest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ use hftbacktest::{
assettype::{InverseAsset, LinearAsset},
data::{read_npz_file, Cache, Data, DataPtr, Reader},
models::{
fee::{CommonFees, FlatPerTradeFeeModel, TradingQtyFeeModel, TradingValueFeeModel},
CommonFees,
ConstantLatency,
FlatPerTradeFeeModel,
IntpOrderLatency,
LogProbQueueFunc,
LogProbQueueFunc2,
Expand All @@ -18,6 +19,8 @@ use hftbacktest::{
PowerProbQueueFunc3,
ProbQueueModel,
RiskAdverseQueueModel,
TradingQtyFeeModel,
TradingValueFeeModel,
},
order::OrderBus,
proc::{Local, LocalProcessor, NoPartialFillExchange, PartialFillExchange, Processor},
Expand Down

0 comments on commit bfb4447

Please sign in to comment.