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
2 changes: 1 addition & 1 deletion docs/binance-orderbook-trade-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Continuous ladder trading is available only for close actions through `Option/Al

Continuous-session feedback stays in the shared ladder status row and uses compact Chinese counters. `2/3 轮` means two rounds completed out of three started, `本轮 1/3 笔` reports the latest partial plan, and `累计 7 笔` reports all confirmed submissions across the session. Confirmed cancellations are appended only when greater than zero. Round outcomes must expose a detached progress snapshot so a terminal continuous summary cannot be overwritten by the latest single-round message.

The active continuous-close control keeps a direction-specific stop action (`停止连续平多` / `停止连续平空`) throughout both execution and inter-round waiting. Before the native submit control is ready, the status places `等待按钮恢复` immediately after the continuous-state label. Only after the fixed cooldown actually begins may it show `1s 后继续` in that same priority position; this is a static duration label, not a countdown. The button must not temporarily revert to a ladder-start action between rounds.
The active continuous-close control keeps a compact direction-specific stop action (`停止平多` / `停止平空`) on one line throughout both execution and inter-round waiting. Before the native submit control is ready, the status places `等待按钮恢复` immediately after the continuous-state label. Only after the fixed cooldown actually begins may it show `1s 后继续` in that same priority position; this is a static duration label, not a countdown. The button must not temporarily revert to a ladder-start action between rounds.

When selecting account-order tabs, scope to the bottom account-orders tab group. Do not globally match `当前委托` or `Open Orders`.

Expand Down
10 changes: 3 additions & 7 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.158
// @version 2.7.159
// @author jackhai9
// @description 单击订单簿价格,按当前开仓/平仓 tab 自动填数量并执行下单,内置数量倍率面板
// @match https://www.binance.com/*/futures/*
Expand Down Expand Up @@ -153,10 +153,6 @@
OPEN_SHORT: "停止开空",
CLOSE_LONG: "停止平多",
CLOSE_SHORT: "停止平空"
}),
stopContinuousLadderByAction: freezeCopy({
CLOSE_LONG: "停止连续平多",
CLOSE_SHORT: "停止连续平空"
})
}),
status: freezeCopy({
Expand Down Expand Up @@ -7067,8 +7063,8 @@
if (activeActionType !== actionType) {
return ladderActionButton(actionType, label, tone, disabled);
}
const stopLabel = activeContinuousLadderActionType === actionType ? PANEL_COPY.action.stopContinuousLadderByAction[actionType] : PANEL_COPY.action.stopLadderByAction[actionType];
return `<button type="button" data-ladder-stop="true" data-ladder-action-origin="${actionType}" style="height:${LADDER_CONTROL_BUTTON_HEIGHT}px;border:1px solid var(--color-PrimaryYellow);border-radius:6px;background:var(--color-BadgeBg);color:#9a6700;font-size:${LADDER_CONTROL_BUTTON_FONT_SIZE}px;font-weight:${CONTROL_FONT_WEIGHT};line-height:${LADDER_CONTROL_BUTTON_HEIGHT - 2}px;cursor:pointer;">${stopLabel}</button>`;
const stopLabel = PANEL_COPY.action.stopLadderByAction[actionType];
return `<button type="button" data-ladder-stop="true" data-ladder-action-origin="${actionType}" style="box-sizing:border-box;min-width:0;height:${LADDER_CONTROL_BUTTON_HEIGHT}px;border:1px solid var(--color-PrimaryYellow);border-radius:6px;background:var(--color-BadgeBg);color:#9a6700;font-size:${LADDER_CONTROL_BUTTON_FONT_SIZE}px;font-weight:${CONTROL_FONT_WEIGHT};line-height:${LADDER_CONTROL_BUTTON_HEIGHT - 2}px;white-space:nowrap;overflow:hidden;cursor:pointer;">${stopLabel}</button>`;
}
function getLadderControlSections(tradeMode, closeContext, symbol, precision) {
const ladderRunning = !!ladderTask || !!continuousLadderTask;
Expand Down
4 changes: 0 additions & 4 deletions src/binance-orderbook-trade/contracts/panel-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export const PANEL_COPY = Object.freeze({
CLOSE_LONG: '停止平多',
CLOSE_SHORT: '停止平空',
}),
stopContinuousLadderByAction: freezeCopy({
CLOSE_LONG: '停止连续平多',
CLOSE_SHORT: '停止连续平空',
}),
}),
status: freezeCopy({
precisionUpdated: '精度推荐已更新',
Expand Down
8 changes: 3 additions & 5 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.158
// @version 2.7.159
// @author jackhai9
// @description 单击订单簿价格,按当前开仓/平仓 tab 自动填数量并执行下单,内置数量倍率面板
// @match https://www.binance.com/*/futures/*
Expand Down Expand Up @@ -5557,10 +5557,8 @@ import {
if (activeActionType !== actionType) {
return ladderActionButton(actionType, label, tone, disabled);
}
const stopLabel = activeContinuousLadderActionType === actionType
? PANEL_COPY.action.stopContinuousLadderByAction[actionType]
: PANEL_COPY.action.stopLadderByAction[actionType];
return `<button type="button" data-ladder-stop="true" data-ladder-action-origin="${actionType}" style="height:${LADDER_CONTROL_BUTTON_HEIGHT}px;border:1px solid var(--color-PrimaryYellow);border-radius:6px;background:var(--color-BadgeBg);color:#9a6700;font-size:${LADDER_CONTROL_BUTTON_FONT_SIZE}px;font-weight:${CONTROL_FONT_WEIGHT};line-height:${LADDER_CONTROL_BUTTON_HEIGHT - 2}px;cursor:pointer;">${stopLabel}</button>`;
const stopLabel = PANEL_COPY.action.stopLadderByAction[actionType];
return `<button type="button" data-ladder-stop="true" data-ladder-action-origin="${actionType}" style="box-sizing:border-box;min-width:0;height:${LADDER_CONTROL_BUTTON_HEIGHT}px;border:1px solid var(--color-PrimaryYellow);border-radius:6px;background:var(--color-BadgeBg);color:#9a6700;font-size:${LADDER_CONTROL_BUTTON_FONT_SIZE}px;font-weight:${CONTROL_FONT_WEIGHT};line-height:${LADDER_CONTROL_BUTTON_HEIGHT - 2}px;white-space:nowrap;overflow:hidden;cursor:pointer;">${stopLabel}</button>`;
}

function getLadderControlSections(tradeMode, closeContext, symbol, precision) {
Expand Down
4 changes: 0 additions & 4 deletions test/unit/binance-orderbook-trade/panel-copy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ test('panel copy keeps the approved labels and tooltips in one contract', () =>
CLOSE_LONG: '停止平多',
CLOSE_SHORT: '停止平空',
},
stopContinuousLadderByAction: {
CLOSE_LONG: '停止连续平多',
CLOSE_SHORT: '停止连续平空',
},
},
status: {
precisionUpdated: '精度推荐已更新',
Expand Down
4 changes: 3 additions & 1 deletion test/unit/binance-orderbook-trade/source-regressions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,9 @@ test('Option or Alt click continuously repeats close ladders only after readines
assert.match(actionButtonBody, /Option\/Alt \+ 单击:连续交易/);
assert.doesNotMatch(source, /Continuous trading (?:stopped|failed)/);
assert.match(executionButtonBody, /activeLadderActionType \|\| activeContinuousLadderActionType/);
assert.match(executionButtonBody, /PANEL_COPY\.action\.stopContinuousLadderByAction\[actionType\]/);
assert.match(executionButtonBody, /PANEL_COPY\.action\.stopLadderByAction\[actionType\]/);
assert.doesNotMatch(source, /stopContinuousLadderByAction/);
assert.match(executionButtonBody, /white-space:nowrap;overflow:hidden/);
assert.match(controlSectionsBody, /!!ladderTask \|\| !!continuousLadderTask/);
});

Expand Down
Loading