mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 08:48:07 +00:00
优化做市引擎、偏移做市引擎和趋势引擎的订单管理逻辑,将待取消订单的类型从数字更改为字符串,确保在处理订单时的类型一致性。同时,增强风险检查逻辑,确保在平仓时使用正确的价格,提升交易策略的稳定性和准确性。
This commit is contained in:
+2
-1
@@ -14,7 +14,8 @@ export function roundQtyDownToStep(value: number, step: number): number {
|
||||
export function decimalsOf(step: number): number {
|
||||
const s = step.toString();
|
||||
if (!s.includes(".")) return 0;
|
||||
return s.split(".")[1].length;
|
||||
const fraction = s.split(".")[1];
|
||||
return fraction ? fraction.length : 0;
|
||||
}
|
||||
|
||||
export function isNearlyZero(value: number, epsilon = 1e-5): boolean {
|
||||
|
||||
Reference in New Issue
Block a user