Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/HourglassDevTeam/HourglassExchange
/ functions
Functions
645 in github.com/HourglassDevTeam/HourglassExchange
⨍
Functions
645
◇
Types & classes
152
↓ 1 callers
Function
test_4_send_market_trade_that_does_not_match_any_open_order
4. 发送一个不匹配任何未完成订单的 MarketTrade,并检查是否没有发送 AccountEvents。注意,这一部分可能存在问题,因为它没有使用`new_market_trade`。 NOTE 其次还要检查一下available的数值处理是否正确。
tests/test_set.rs:227
↓ 1 callers
Function
test_5_cancel_buy_order
// 5. Cancel the open buy order and check AccountEvents for cancelled order and balance are sent.
tests/test_set.rs:248
↓ 1 callers
Function
test_6_open_2x_limit_buy_orders
6. 开两个限价买单,并检查是否发送了关于余额和新订单的 AccountEvents
tests/test_set.rs:303
↓ 1 callers
Method
topup_bitcoin_with_usdt
NOTE : BETA功能,待测试。 用 `u本位` (USDT) 买 `b本位` (BTC)。 # 参数 `usdt_amount` - 用于购买的 USDT 数额。 `btc_price` - 当前 BTC 的价格(USDT/BTC)。 # 返回值 返回更新后的 `TokenBalanc
src/hourglass/account/mod.rs:295
↓ 1 callers
Method
try_init
尝试构建并设置成全局日志记录器。
src/hourglass_log/mod.rs:704
↓ 1 callers
Method
update
迭代更新 Dispersion 的度量,包括范围、方差和标准差。 # 原理解释 当你向数据集中添加新数据时,我们需要动态更新这些统计量。 这个方法通过提供前一个均值、新的均值、新的值和数据集中的值的数量来实现。 具体步骤如下: 1. **更新范围(Range)**:检查新值是否比当前的最大值更大
src/dashboard/dispersion.rs:47
↓ 1 callers
Method
update_avg_price
(&mut self, trade_price: f64, trade_size: f64, trade_side: Side)
src/common/account_positions/position_meta.rs:100
↓ 1 callers
Method
update_exchange_ts
更新交易所时间辍
src/hourglass/account/account_handlers/trade_handler.rs:278
↓ 1 callers
Method
update_existing_position
更新已有仓位
src/hourglass/account/account_handlers/position_handler.rs:793
↓ 1 callers
Method
update_from_trade
(&mut self, trade: &ClientTrade)
src/common/account_positions/position_meta.rs:29
↓ 1 callers
Method
update_funding_fee
更新资金费用
src/common/account_positions/future.rs:26
↓ 1 callers
Method
update_latency
更新账户的延迟值。 该函数通过调用 [fluctuate_latency] 方法来更新账户的延迟生成器,并根据当前的时间进行动态调整。 更新后的延迟值将用于模拟订单的延迟,适用于回测或模拟环境。 # 参数 - current_time: 当前时间,以微秒为单位,作为调整延迟值的参考点。
src/hourglass/account/account_orders.rs:512
↓ 1 callers
Method
update_liquidation_price
更新平仓价格
src/common/account_positions/future.rs:20
↓ 1 callers
Method
update_liquidation_price
更新平仓价格
src/common/account_positions/perpetual.rs:21
↓ 1 callers
Method
update_realised_pnl
更新 realised_pnl 并清空持仓
src/common/account_positions/position_meta.rs:140
Function
account_event_kind_should_handle_all_variants
()
src/common/event.rs:87
Function
account_event_kind_should_serialize_and_deserialize_correctly
()
src/common/event.rs:71
Function
account_event_should_serialize_and_deserialize_correctly
()
src/common/event.rs:60
Method
account_event_tx
(mut self, value: UnboundedSender<AccountEvent>)
src/hourglass/account/mod.rs:125
Method
annual
计算年化比率,使用指定的交易天数。
src/dashboard/metrics/ratio.rs:20
Method
appender
(mut self, name: &'static str, appender: impl Write + Send + 'static)
src/hourglass_log/mod.rs:516
Method
as_u64
获取 `u64` 值
src/common/account_positions/position_id.rs:26
Function
balance_apply_should_apply_balance_delta
()
src/common/balance.rs:108
Function
balance_delta_new_should_create_balance_delta
()
src/common/balance.rs:118
Function
balance_new_should_create_balance
()
src/common/balance.rs:93
Function
balance_used_should_return_used_balance
()
src/common/balance.rs:101
Method
balances
(mut self, value: DashMap<Token, Balance>)
src/hourglass/account/mod.rs:143
Method
bounded
(mut self, size: usize, block_when_full: bool)
src/hourglass_log/mod.rs:486
Method
btc
构造一个表示 "BTC" 的 [`Token`]。
src/common/token.rs:55
Method
build
(self)
src/hourglass/account/mod.rs:155
Method
build
(self)
src/hourglass/account/account_config.rs:83
Method
build
(self)
src/common/account_positions/position_meta.rs:274
Method
build
(self)
src/common/account_positions/future.rs:114
Method
build
(self)
src/common/account_positions/perpetual.rs:105
Method
builder
构建器模式,用于构造仓库。 # 返回 返回一个新的 `RedisVaultBuilder` 实例,该实例可以逐步配置并最终构建 `RedisVault`。
src/vault/redis.rs:64
Method
builder
()
src/hourglass/mod.rs:52
Method
builder
()
src/hourglass/account/account_config.rs:50
Method
builder
()
src/hourglass_log/appender/file.rs:109
Function
builder_should_create_exchange_builder_with_default_values
()
src/hourglass/mod.rs:288
Function
builder_should_return_error_if_account_is_missing
()
src/hourglass/mod.rs:323
Function
builder_should_return_error_if_event_hourglass_rx_is_missing
()
src/hourglass/mod.rs:313
Function
builder_should_set_account
()
src/hourglass/mod.rs:304
Function
builder_should_set_event_hourglass_rx
()
src/hourglass/mod.rs:296
Function
calculate_fees
计算 [`Order<Open>`] 对应的 [`Fees`]
src/hourglass/open_orders_book.rs:31
Function
calculate_mean
()
src/dashboard/welford_online.rs:84
Function
calculate_population_variance
()
src/dashboard/welford_online.rs:196
Function
calculate_recurrence_relation_m
()
src/dashboard/welford_online.rs:123
Function
calculate_sample_variance
()
src/dashboard/welford_online.rs:183
Method
cancel_order
取消订单 NOTE 注意和Account模块的兼容性
src/hourglass/hourglass_orderbook/mod.rs:196
Method
cancel_orders
(&self, cancel_requests: Vec<Order<RequestCancel>>)
src/hourglass/hourglass_client_local_mode.rs:143
Function
client_order_id_should_format_correctly
()
src/common/event.rs:80
Function
combine
合并多个表格生成器,生成一个包含所有行数据的完整表格。 # 参数 - `builders`: 表格生成器的迭代器,每个生成器都包含一个 ID 字符串和实现了 `TableBuilder` 特性的对象。 # 返回 返回包含所有行数据的合并表格。
src/dashboard/summary/mod.rs:106
Method
commission_level
(mut self, commission_level: CommissionLevel)
src/hourglass/account/account_config.rs:204
Method
config
设置配置。
src/vault/redis.rs:125
Method
config
(mut self, value: AccountConfig)
src/hourglass/account/mod.rs:131
Method
conn
设置 Redis 连接。
src/vault/redis.rs:118
Method
contribute
预留部分资金进入风险准备金池
src/hourglass/risk_reserve/mod.rs:20
Method
create_from_trade
创建新的 `PositionMeta` 基于 `ClientTrade`
src/common/account_positions/position_meta.rs:61
Method
create_from_trade_with_remaining
(trade: &ClientTrade, remaining_quantity: f64)
src/common/account_positions/position_meta.rs:79
Method
create_future_position
更新 FuturePosition 的方法(占位符)
src/hourglass/account/account_handlers/position_handler.rs:515
Method
create_leveraged_token_position
更新 LeveragedTokenPosition 的方法(占位符)
src/hourglass/account/account_handlers/position_handler.rs:529
Method
create_option_position
更新 OptionPosition 的方法(占位符)
src/hourglass/account/account_handlers/position_handler.rs:522
Function
create_test_account_orders
帮助函数,用于创建测试用的 AccountOrders 实例
src/test_utils.rs:72
Function
create_test_future_position_with_side
创建一个测试用的 `FuturePosition` 实例,指定 `Side`。
src/test_utils.rs:200
Function
create_test_instrument
创建一个测试用的 `Instrument` 实例。
src/test_utils.rs:47
Function
create_test_order_open
创建一个测试用的 `Order<Open>` 实例。
src/test_utils.rs:80
Function
create_test_perpetual_position
创建一个测试用的 `PerpetualPosition` 实例。
src/test_utils.rs:175
Function
create_test_request_open
帮助函数,用于创建测试用的订单
src/test_utils.rs:98
Method
current_avg_price
(mut self, current_avg_price: f64)
src/common/account_positions/position_meta.rs:256
Method
current_avg_price_gross
(mut self, current_avg_price_gross: f64)
src/common/account_positions/position_meta.rs:244
Method
current_fees_total
(mut self, current_fees_total: f64)
src/common/account_positions/position_meta.rs:238
Method
current_size
(mut self, current_size: f64)
src/common/account_positions/position_meta.rs:232
Method
current_symbol_price
(mut self, current_symbol_price: f64)
src/common/account_positions/position_meta.rs:250
Method
daily
计算日内比率。
src/dashboard/metrics/ratio.rs:15
Function
de_duration_from_secs
将表示秒数的数字反序列化为 [`Duration`]。 # 原理介绍 在反序列化过程中,我们需要将简单的数字格式(例如 JSON 中的整数)转换回 Rust 的 `Duration` 类型。 这个函数接收一个表示秒数的整数,并将其转换为 `Duration` 类型。
src/dashboard/mod.rs:26
Method
deduct
从准备金中扣除,用于弥补爆仓亏损
src/hourglass/risk_reserve/mod.rs:26
Method
default
()
src/hourglass/mod.rs:219
Method
default
()
src/hourglass/clickhouse_api/queries_operations.rs:29
Method
default
()
src/hourglass/clickhouse_api/query_builder/mod.rs:15
Method
default
()
src/hourglass/account/mod.rs:107
Method
default
()
src/hourglass/account/account_config.rs:58
Method
default
()
src/hourglass_log/mod.rs:714
Method
default
()
src/common/account_positions/position_meta.rs:295
Method
default
()
src/common/account_positions/future.rs:73
Method
default
()
src/common/account_positions/perpetual.rs:70
Method
default
()
src/common/instrument/kind.rs:21
Method
default
()
src/common/instrument/mod.rs:62
Method
default
默认构造函数,初始化 `EquitySnapshot`,将 `time` 设置为当前时间,`total` 初始化为 `0.0`。
src/dashboard/metrics/mod.rs:33
Method
default
创建一个默认的 [`Drawdown`] 实例,所有字段初始化为默认值。
src/dashboard/metrics/drawdown.rs:28
Method
default
()
src/dashboard/summary/pnl.rs:31
Method
deposit_multiple_coins_and_respond
为账户充值 `u本位` 稳定币(USDT)。 并返回充值结果。
src/hourglass/account/mod.rs:248
Method
deref
(&self)
src/common/token.rs:31
Method
deserialize
(deserializer: D)
src/common/account_positions/mod.rs:147
Method
deserialize
(deserializer: D)
src/common/account_positions/exited_positions.rs:204
Function
determine_exited_positions_id
返回给定 session_id 的投资组合的已退出 [`Position`] 的唯一标识符。
src/vault/mod.rs:59
Method
drop
(&mut self)
src/hourglass_log/mod.rs:283
Method
enabled
(&self, metadata: &Metadata)
src/hourglass_log/mod.rs:317
Method
enter_ts
(mut self, enter_ts: i64)
src/common/account_positions/position_meta.rs:196
Method
eq
(&self, other: &Self)
src/hourglass/clickhouse_api/queries_operations.rs:60
Method
eq
(&self, other: &Self)
src/common/account_positions/mod.rs:117
← previous
next →
201–300 of 645, ranked by callers