Skip to content
Merged
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
5 changes: 2 additions & 3 deletions scripts/binance-orderbook-trade.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace binance.orderbook.trade
// @icon data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E
// @icon64 data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E
// @version 2.7.152
// @version 2.7.153
// @author jackhai9
// @description 单击订单簿价格,按当前开仓/平仓 tab 自动填数量并执行下单,内置数量倍率面板
// @match https://www.binance.com/*/futures/*
Expand Down Expand Up @@ -5946,8 +5946,7 @@
}
function formatLadderPlanStatus(plan) {
const levelText = plan.levels === plan.requestedLevels ? `${plan.levels}档` : `${plan.levels}/${plan.requestedLevels}档`;
const stepText = plan.ladderStep === DEFAULT_LADDER_STEP ? "" : `/幅${plan.ladderStep}`;
return `${plan.spec.label}计划:${plan.percent}%/${levelText}${stepText}`;
return `${plan.spec.label}计划:${plan.percent}% / ${levelText} / 幅${plan.ladderStep}`;
}
function isReplaceableCloseLadderOpenOrdersFailure(plan, error) {
if (plan?.spec?.mode !== "CLOSE") return false;
Expand Down
5 changes: 2 additions & 3 deletions src/binance-orderbook-trade/index.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace binance.orderbook.trade
// @icon data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E
// @icon64 data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E
// @version 2.7.152
// @version 2.7.153
// @author jackhai9
// @description 单击订单簿价格,按当前开仓/平仓 tab 自动填数量并执行下单,内置数量倍率面板
// @match https://www.binance.com/*/futures/*
Expand Down Expand Up @@ -4456,8 +4456,7 @@ import {
const levelText = plan.levels === plan.requestedLevels
? `${plan.levels}档`
: `${plan.levels}/${plan.requestedLevels}档`;
const stepText = plan.ladderStep === DEFAULT_LADDER_STEP ? '' : `/幅${plan.ladderStep}`;
return `${plan.spec.label}计划:${plan.percent}%/${levelText}${stepText}`;
return `${plan.spec.label}计划:${plan.percent}% / ${levelText} / 幅${plan.ladderStep}`;
}

function isReplaceableCloseLadderOpenOrdersFailure(plan, error) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/binance-orderbook-trade/ladder-options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ test('ladder execution and UI updates use one captured mode-symbol-precision con
assert.match(source, /const optionContext = getPanelOptionContext\(\)/);
assert.match(source, /setLadderLevels\(value, optionContext\.mode, optionContext\.symbol, optionContext\.precision\)/);
assert.match(source, /setLadderStep\(value, optionContext\.mode, optionContext\.symbol, optionContext\.precision\)/);
assert.match(source, /plan\.ladderStep === DEFAULT_LADDER_STEP \? '' : `\/幅\$\{plan\.ladderStep\}`/);
assert.match(source, /计划:\$\{plan\.percent\}% \/ \$\{levelText\} \/ 幅\$\{plan\.ladderStep\}/);
});

test('open and close ladder percentage rows share the centralized ratio label', () => {
Expand Down
3 changes: 2 additions & 1 deletion test/unit/binance-orderbook-trade/source-regressions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,8 @@ test('ladder task statuses name the active action and observed outcome', () => {
assert.match(startBody, /formatFailedLadderProgress\(spec\.label,\s*failureMessage,\s*progress\)/);
assert.match(stopBody, /`\$\{activeSpec\.label\}停止中`/);
assert.match(cancelPlanBody, /setPlanStepStatus\(`撤销 \$\{rowsToCancel\.length\} 笔当前币挂单`\)/);
assert.match(planStatusBody, /`\$\{plan\.spec\.label\}计划:/);
assert.match(planStatusBody, /`\$\{plan\.spec\.label\}计划:\$\{plan\.percent\}% \/ \$\{levelText\} \/ 幅\$\{plan\.ladderStep\}`/);
assert.doesNotMatch(planStatusBody, /%\/|\/幅/);
assert.match(replacementStatusBody, /`\$\{plan\.spec\.label\}:/);
assert.match(cancelPlanBody, /const setPlanStepStatus = \(message\) =>/);
assert.doesNotMatch(cancelPlanBody, /setLadderStatus\(message\)/);
Expand Down
Loading