Skip to content

Commit d95967b

Browse files
Pigbibicursoragent
andcommitted
Fix cash-only execution platform default to cash only when unset.
QuantPlatformKit and all equity platforms default cash_only_execution to true when the env var is missing; align console summary and effective-value logic with that behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a69300e commit d95967b

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

tests/strategy_switch_worker_validation.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ assert.ok(indexHtml.includes('class="reserve-policy-stack"'));
5252
assert.equal(indexHtml.match(/class="form-section dca-section"/g)?.length, 1);
5353
assert.ok(indexHtml.includes('qmtDryRunOnlyNote'));
5454
assert.ok(indexHtml.includes('optionOverlayDefaultSimple: "策略默认:开启"'));
55-
assert.ok(indexHtml.includes('cashOnlyExecutionDefault: "平台默认:允许融资"'));
55+
assert.ok(indexHtml.includes('cashOnlyExecutionDefault: "平台默认:仅用现金"'));
56+
assert.match(indexHtml, /function platformCashOnlyExecutionDefault\(\) \{\s+return true;/);
5657
assert.ok(indexHtml.includes("function effectiveOptionOverlayForAccount("));
5758
assert.ok(indexHtml.includes("function effectiveCashOnlyExecutionForAccount("));
5859
assert.ok(indexHtml.includes('cashOnlyExecutionValueYes: "允许融资:是"'));

web/strategy-switch-console/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ <h2 data-i18n="summary">切换摘要</h2>
17891789
optionOverlayOn: "开启(策略默认)",
17901790
optionOverlayDefaultSimple: "策略默认:开启",
17911791
optionOverlayDefault: "策略默认:开启,{detail}",
1792-
cashOnlyExecutionDefault: "平台默认:允许融资",
1792+
cashOnlyExecutionDefault: "平台默认:仅用现金",
17931793
},
17941794
en: {
17951795
appTitle: "Strategy Switch",
@@ -1955,7 +1955,7 @@ <h2 data-i18n="summary">切换摘要</h2>
19551955
optionOverlayOn: "Enabled (strategy default)",
19561956
optionOverlayDefaultSimple: "Strategy default: enabled",
19571957
optionOverlayDefault: "Strategy default: enabled, {detail}",
1958-
cashOnlyExecutionDefault: "Platform default: margin allowed",
1958+
cashOnlyExecutionDefault: "Platform default: cash only",
19591959
},
19601960
};
19611961

@@ -2475,7 +2475,7 @@ <h2 data-i18n="summary">切换摘要</h2>
24752475
}
24762476

24772477
function platformCashOnlyExecutionDefault() {
2478-
return false;
2478+
return true;
24792479
}
24802480

24812481
function effectiveCashOnlyExecutionForAccount(platform, account) {

web/strategy-switch-console/page_asset.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)