MCPcopy Create free account

hub / github.com/HourglassDevTeam/HourglassExchange / functions

Functions645 in github.com/HourglassDevTeam/HourglassExchange

↓ 1 callersFunctiontest_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 callersFunctiontest_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 callersFunctiontest_6_open_2x_limit_buy_orders
6. 开两个限价买单,并检查是否发送了关于余额和新订单的 AccountEvents
tests/test_set.rs:303
↓ 1 callersMethodtopup_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 callersMethodtry_init
尝试构建并设置成全局日志记录器。
src/hourglass_log/mod.rs:704
↓ 1 callersMethodupdate
迭代更新 Dispersion 的度量,包括范围、方差和标准差。 # 原理解释 当你向数据集中添加新数据时,我们需要动态更新这些统计量。 这个方法通过提供前一个均值、新的均值、新的值和数据集中的值的数量来实现。 具体步骤如下: 1. **更新范围(Range)**:检查新值是否比当前的最大值更大
src/dashboard/dispersion.rs:47
↓ 1 callersMethodupdate_avg_price
(&mut self, trade_price: f64, trade_size: f64, trade_side: Side)
src/common/account_positions/position_meta.rs:100
↓ 1 callersMethodupdate_exchange_ts
更新交易所时间辍
src/hourglass/account/account_handlers/trade_handler.rs:278
↓ 1 callersMethodupdate_existing_position
更新已有仓位
src/hourglass/account/account_handlers/position_handler.rs:793
↓ 1 callersMethodupdate_from_trade
(&mut self, trade: &ClientTrade)
src/common/account_positions/position_meta.rs:29
↓ 1 callersMethodupdate_funding_fee
更新资金费用
src/common/account_positions/future.rs:26
↓ 1 callersMethodupdate_latency
更新账户的延迟值。 该函数通过调用 [fluctuate_latency] 方法来更新账户的延迟生成器,并根据当前的时间进行动态调整。 更新后的延迟值将用于模拟订单的延迟,适用于回测或模拟环境。 # 参数 - current_time: 当前时间,以微秒为单位,作为调整延迟值的参考点。
src/hourglass/account/account_orders.rs:512
↓ 1 callersMethodupdate_liquidation_price
更新平仓价格
src/common/account_positions/future.rs:20
↓ 1 callersMethodupdate_liquidation_price
更新平仓价格
src/common/account_positions/perpetual.rs:21
↓ 1 callersMethodupdate_realised_pnl
更新 realised_pnl 并清空持仓
src/common/account_positions/position_meta.rs:140
Functionaccount_event_kind_should_handle_all_variants
()
src/common/event.rs:87
Functionaccount_event_kind_should_serialize_and_deserialize_correctly
()
src/common/event.rs:71
Functionaccount_event_should_serialize_and_deserialize_correctly
()
src/common/event.rs:60
Methodaccount_event_tx
(mut self, value: UnboundedSender<AccountEvent>)
src/hourglass/account/mod.rs:125
Methodannual
计算年化比率,使用指定的交易天数。
src/dashboard/metrics/ratio.rs:20
Methodappender
(mut self, name: &'static str, appender: impl Write + Send + 'static)
src/hourglass_log/mod.rs:516
Methodas_u64
获取 `u64` 值
src/common/account_positions/position_id.rs:26
Functionbalance_apply_should_apply_balance_delta
()
src/common/balance.rs:108
Functionbalance_delta_new_should_create_balance_delta
()
src/common/balance.rs:118
Functionbalance_new_should_create_balance
()
src/common/balance.rs:93
Functionbalance_used_should_return_used_balance
()
src/common/balance.rs:101
Methodbalances
(mut self, value: DashMap<Token, Balance>)
src/hourglass/account/mod.rs:143
Methodbounded
(mut self, size: usize, block_when_full: bool)
src/hourglass_log/mod.rs:486
Methodbtc
构造一个表示 "BTC" 的 [`Token`]。
src/common/token.rs:55
Methodbuild
(self)
src/hourglass/account/mod.rs:155
Methodbuild
(self)
src/hourglass/account/account_config.rs:83
Methodbuild
(self)
src/common/account_positions/position_meta.rs:274
Methodbuild
(self)
src/common/account_positions/future.rs:114
Methodbuild
(self)
src/common/account_positions/perpetual.rs:105
Methodbuilder
构建器模式,用于构造仓库。 # 返回 返回一个新的 `RedisVaultBuilder` 实例,该实例可以逐步配置并最终构建 `RedisVault`。
src/vault/redis.rs:64
Methodbuilder
()
src/hourglass/mod.rs:52
Methodbuilder
()
src/hourglass/account/account_config.rs:50
Methodbuilder
()
src/hourglass_log/appender/file.rs:109
Functionbuilder_should_create_exchange_builder_with_default_values
()
src/hourglass/mod.rs:288
Functionbuilder_should_return_error_if_account_is_missing
()
src/hourglass/mod.rs:323
Functionbuilder_should_return_error_if_event_hourglass_rx_is_missing
()
src/hourglass/mod.rs:313
Functionbuilder_should_set_account
()
src/hourglass/mod.rs:304
Functionbuilder_should_set_event_hourglass_rx
()
src/hourglass/mod.rs:296
Functioncalculate_fees
计算 [`Order<Open>`] 对应的 [`Fees`]
src/hourglass/open_orders_book.rs:31
Functioncalculate_mean
()
src/dashboard/welford_online.rs:84
Functioncalculate_population_variance
()
src/dashboard/welford_online.rs:196
Functioncalculate_recurrence_relation_m
()
src/dashboard/welford_online.rs:123
Functioncalculate_sample_variance
()
src/dashboard/welford_online.rs:183
Methodcancel_order
取消订单 NOTE 注意和Account模块的兼容性
src/hourglass/hourglass_orderbook/mod.rs:196
Methodcancel_orders
(&self, cancel_requests: Vec<Order<RequestCancel>>)
src/hourglass/hourglass_client_local_mode.rs:143
Functionclient_order_id_should_format_correctly
()
src/common/event.rs:80
Functioncombine
合并多个表格生成器,生成一个包含所有行数据的完整表格。 # 参数 - `builders`: 表格生成器的迭代器,每个生成器都包含一个 ID 字符串和实现了 `TableBuilder` 特性的对象。 # 返回 返回包含所有行数据的合并表格。
src/dashboard/summary/mod.rs:106
Methodcommission_level
(mut self, commission_level: CommissionLevel)
src/hourglass/account/account_config.rs:204
Methodconfig
设置配置。
src/vault/redis.rs:125
Methodconfig
(mut self, value: AccountConfig)
src/hourglass/account/mod.rs:131
Methodconn
设置 Redis 连接。
src/vault/redis.rs:118
Methodcontribute
预留部分资金进入风险准备金池
src/hourglass/risk_reserve/mod.rs:20
Methodcreate_from_trade
创建新的 `PositionMeta` 基于 `ClientTrade`
src/common/account_positions/position_meta.rs:61
Methodcreate_from_trade_with_remaining
(trade: &ClientTrade, remaining_quantity: f64)
src/common/account_positions/position_meta.rs:79
Methodcreate_future_position
更新 FuturePosition 的方法(占位符)
src/hourglass/account/account_handlers/position_handler.rs:515
Methodcreate_leveraged_token_position
更新 LeveragedTokenPosition 的方法(占位符)
src/hourglass/account/account_handlers/position_handler.rs:529
Methodcreate_option_position
更新 OptionPosition 的方法(占位符)
src/hourglass/account/account_handlers/position_handler.rs:522
Functioncreate_test_account_orders
帮助函数,用于创建测试用的 AccountOrders 实例
src/test_utils.rs:72
Functioncreate_test_future_position_with_side
创建一个测试用的 `FuturePosition` 实例,指定 `Side`。
src/test_utils.rs:200
Functioncreate_test_instrument
创建一个测试用的 `Instrument` 实例。
src/test_utils.rs:47
Functioncreate_test_order_open
创建一个测试用的 `Order<Open>` 实例。
src/test_utils.rs:80
Functioncreate_test_perpetual_position
创建一个测试用的 `PerpetualPosition` 实例。
src/test_utils.rs:175
Functioncreate_test_request_open
帮助函数,用于创建测试用的订单
src/test_utils.rs:98
Methodcurrent_avg_price
(mut self, current_avg_price: f64)
src/common/account_positions/position_meta.rs:256
Methodcurrent_avg_price_gross
(mut self, current_avg_price_gross: f64)
src/common/account_positions/position_meta.rs:244
Methodcurrent_fees_total
(mut self, current_fees_total: f64)
src/common/account_positions/position_meta.rs:238
Methodcurrent_size
(mut self, current_size: f64)
src/common/account_positions/position_meta.rs:232
Methodcurrent_symbol_price
(mut self, current_symbol_price: f64)
src/common/account_positions/position_meta.rs:250
Methoddaily
计算日内比率。
src/dashboard/metrics/ratio.rs:15
Functionde_duration_from_secs
将表示秒数的数字反序列化为 [`Duration`]。 # 原理介绍 在反序列化过程中,我们需要将简单的数字格式(例如 JSON 中的整数)转换回 Rust 的 `Duration` 类型。 这个函数接收一个表示秒数的整数,并将其转换为 `Duration` 类型。
src/dashboard/mod.rs:26
Methoddeduct
从准备金中扣除,用于弥补爆仓亏损
src/hourglass/risk_reserve/mod.rs:26
Methoddefault
()
src/hourglass/mod.rs:219
Methoddefault
()
src/hourglass/clickhouse_api/queries_operations.rs:29
Methoddefault
()
src/hourglass/clickhouse_api/query_builder/mod.rs:15
Methoddefault
()
src/hourglass/account/mod.rs:107
Methoddefault
()
src/hourglass/account/account_config.rs:58
Methoddefault
()
src/hourglass_log/mod.rs:714
Methoddefault
()
src/common/account_positions/position_meta.rs:295
Methoddefault
()
src/common/account_positions/future.rs:73
Methoddefault
()
src/common/account_positions/perpetual.rs:70
Methoddefault
()
src/common/instrument/kind.rs:21
Methoddefault
()
src/common/instrument/mod.rs:62
Methoddefault
默认构造函数,初始化 `EquitySnapshot`,将 `time` 设置为当前时间,`total` 初始化为 `0.0`。
src/dashboard/metrics/mod.rs:33
Methoddefault
创建一个默认的 [`Drawdown`] 实例,所有字段初始化为默认值。
src/dashboard/metrics/drawdown.rs:28
Methoddefault
()
src/dashboard/summary/pnl.rs:31
Methoddeposit_multiple_coins_and_respond
为账户充值 `u本位` 稳定币(USDT)。 并返回充值结果。
src/hourglass/account/mod.rs:248
Methodderef
(&self)
src/common/token.rs:31
Methoddeserialize
(deserializer: D)
src/common/account_positions/mod.rs:147
Methoddeserialize
(deserializer: D)
src/common/account_positions/exited_positions.rs:204
Functiondetermine_exited_positions_id
返回给定 session_id 的投资组合的已退出 [`Position`] 的唯一标识符。
src/vault/mod.rs:59
Methoddrop
(&mut self)
src/hourglass_log/mod.rs:283
Methodenabled
(&self, metadata: &Metadata)
src/hourglass_log/mod.rs:317
Methodenter_ts
(mut self, enter_ts: i64)
src/common/account_positions/position_meta.rs:196
Methodeq
(&self, other: &Self)
src/hourglass/clickhouse_api/queries_operations.rs:60
Methodeq
(&self, other: &Self)
src/common/account_positions/mod.rs:117
← previousnext →201–300 of 645, ranked by callers