Skip to content

Commit 8008e65

Browse files
committed
feat(protection): expose protection events and strategy parameters
Signed-off-by: TIANHE <[email protected]>
1 parent 4f4b3b1 commit 8008e65

8 files changed

Lines changed: 271 additions & 8 deletions

File tree

‎src/locales/lang/backtest-workbench.js‎

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ const en = {
55
'backtestWorkbench.factor': 'Research factor',
66
'backtestWorkbench.advancedSettings': 'Advanced settings',
77
'backtestWorkbench.hideSettings': 'Hide settings',
8+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'Protection events ({count})',
9+
'strategyV2.backtest.noProtectionEvents': 'No native protection event was triggered in this run.',
10+
'strategyV2.backtest.executionType': 'Execution type',
11+
'strategyV2.backtest.protectionTriggerPrice': 'Trigger price',
12+
'strategyV2.backtest.protectionFillReferencePrice': 'Fill reference',
13+
'strategyV2.backtest.protectionExitFraction': 'Exit fraction',
814
'backtestWorkbench.stage.running': 'Starting research job',
915
'backtestWorkbench.stage.preparing': 'Validating strategy contract',
1016
'backtestWorkbench.stage.loading_market_data': 'Loading and aligning market data',
@@ -23,6 +29,12 @@ const zhCN = {
2329
'backtestWorkbench.factor': '研究因子',
2430
'backtestWorkbench.advancedSettings': '高级设置',
2531
'backtestWorkbench.hideSettings': '收起设置',
32+
'strategyV2.backtest.tabs.protectionEventsWithCount': '保护事件({count})',
33+
'strategyV2.backtest.noProtectionEvents': '本次回测没有触发原生保护条件。',
34+
'strategyV2.backtest.executionType': '执行类型',
35+
'strategyV2.backtest.protectionTriggerPrice': '触发价格',
36+
'strategyV2.backtest.protectionFillReferencePrice': '成交参考价',
37+
'strategyV2.backtest.protectionExitFraction': '退出比例',
2638
'backtestWorkbench.stage.running': '正在启动研究任务',
2739
'backtestWorkbench.stage.preparing': '正在校验策略契约',
2840
'backtestWorkbench.stage.loading_market_data': '正在加载并对齐行情数据',
@@ -41,6 +53,12 @@ const zhTW = {
4153
'backtestWorkbench.factor': '研究因子',
4254
'backtestWorkbench.advancedSettings': '進階設定',
4355
'backtestWorkbench.hideSettings': '收起設定',
56+
'strategyV2.backtest.tabs.protectionEventsWithCount': '保護事件({count})',
57+
'strategyV2.backtest.noProtectionEvents': '本次回測沒有觸發原生保護條件。',
58+
'strategyV2.backtest.executionType': '執行類型',
59+
'strategyV2.backtest.protectionTriggerPrice': '觸發價格',
60+
'strategyV2.backtest.protectionFillReferencePrice': '成交參考價',
61+
'strategyV2.backtest.protectionExitFraction': '退出比例',
4462
'backtestWorkbench.stage.running': '正在啟動研究任務',
4563
'backtestWorkbench.stage.preparing': '正在驗證策略契約',
4664
'backtestWorkbench.stage.loading_market_data': '正在載入並對齊行情資料',
@@ -52,12 +70,90 @@ const zhTW = {
5270
'backtestWorkbench.stage.succeeded': '回測已完成'
5371
}
5472

73+
const ar = {
74+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'أحداث الحماية ({count})',
75+
'strategyV2.backtest.noProtectionEvents': 'لم يتم تفعيل أي حدث حماية أصلي في هذه الجولة.',
76+
'strategyV2.backtest.executionType': 'نوع التنفيذ',
77+
'strategyV2.backtest.protectionTriggerPrice': 'سعر التفعيل',
78+
'strategyV2.backtest.protectionFillReferencePrice': 'السعر المرجعي للتنفيذ',
79+
'strategyV2.backtest.protectionExitFraction': 'نسبة الخروج'
80+
}
81+
82+
const de = {
83+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'Schutzereignisse ({count})',
84+
'strategyV2.backtest.noProtectionEvents': 'In diesem Lauf wurde kein natives Schutzereignis ausgelöst.',
85+
'strategyV2.backtest.executionType': 'Ausführungstyp',
86+
'strategyV2.backtest.protectionTriggerPrice': 'Auslösepreis',
87+
'strategyV2.backtest.protectionFillReferencePrice': 'Ausführungsreferenz',
88+
'strategyV2.backtest.protectionExitFraction': 'Ausstiegsanteil'
89+
}
90+
91+
const fr = {
92+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'Événements de protection ({count})',
93+
'strategyV2.backtest.noProtectionEvents': "Aucun événement de protection natif n'a été déclenché pendant ce test.",
94+
'strategyV2.backtest.executionType': "Type d'exécution",
95+
'strategyV2.backtest.protectionTriggerPrice': 'Prix de déclenchement',
96+
'strategyV2.backtest.protectionFillReferencePrice': "Référence d'exécution",
97+
'strategyV2.backtest.protectionExitFraction': 'Part de sortie'
98+
}
99+
100+
const ja = {
101+
'strategyV2.backtest.tabs.protectionEventsWithCount': '保護イベント({count})',
102+
'strategyV2.backtest.noProtectionEvents': 'この実行ではネイティブ保護イベントは発動しませんでした。',
103+
'strategyV2.backtest.executionType': '約定タイプ',
104+
'strategyV2.backtest.protectionTriggerPrice': 'トリガー価格',
105+
'strategyV2.backtest.protectionFillReferencePrice': '約定参照価格',
106+
'strategyV2.backtest.protectionExitFraction': '決済比率'
107+
}
108+
109+
const ko = {
110+
'strategyV2.backtest.tabs.protectionEventsWithCount': '보호 이벤트 ({count})',
111+
'strategyV2.backtest.noProtectionEvents': '이번 실행에서는 네이티브 보호 이벤트가 발동되지 않았습니다.',
112+
'strategyV2.backtest.executionType': '체결 유형',
113+
'strategyV2.backtest.protectionTriggerPrice': '발동 가격',
114+
'strategyV2.backtest.protectionFillReferencePrice': '체결 기준가',
115+
'strategyV2.backtest.protectionExitFraction': '청산 비율'
116+
}
117+
118+
const ru = {
119+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'События защиты ({count})',
120+
'strategyV2.backtest.noProtectionEvents': 'В этом прогоне встроенные события защиты не срабатывали.',
121+
'strategyV2.backtest.executionType': 'Тип исполнения',
122+
'strategyV2.backtest.protectionTriggerPrice': 'Цена срабатывания',
123+
'strategyV2.backtest.protectionFillReferencePrice': 'Ориентир исполнения',
124+
'strategyV2.backtest.protectionExitFraction': 'Доля выхода'
125+
}
126+
127+
const th = {
128+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'เหตุการณ์ป้องกัน ({count})',
129+
'strategyV2.backtest.noProtectionEvents': 'ไม่มีเหตุการณ์ป้องกันแบบเนทีฟถูกเรียกใช้ในการทดสอบครั้งนี้',
130+
'strategyV2.backtest.executionType': 'ประเภทการดำเนินการ',
131+
'strategyV2.backtest.protectionTriggerPrice': 'ราคาทริกเกอร์',
132+
'strategyV2.backtest.protectionFillReferencePrice': 'ราคาอ้างอิงการจับคู่',
133+
'strategyV2.backtest.protectionExitFraction': 'สัดส่วนการออก'
134+
}
135+
136+
const vi = {
137+
'strategyV2.backtest.tabs.protectionEventsWithCount': 'Sự kiện bảo vệ ({count})',
138+
'strategyV2.backtest.noProtectionEvents': 'Không có sự kiện bảo vệ gốc nào được kích hoạt trong lần chạy này.',
139+
'strategyV2.backtest.executionType': 'Loại thực thi',
140+
'strategyV2.backtest.protectionTriggerPrice': 'Giá kích hoạt',
141+
'strategyV2.backtest.protectionFillReferencePrice': 'Giá tham chiếu khớp lệnh',
142+
'strategyV2.backtest.protectionExitFraction': 'Tỷ lệ thoát'
143+
}
144+
55145
const messages = {
56146
'en-US': en,
57147
'zh-CN': zhCN,
58-
'zh-TW': zhTW
148+
'zh-TW': zhTW,
149+
'ar-SA': { ...en, ...ar },
150+
'de-DE': { ...en, ...de },
151+
'fr-FR': { ...en, ...fr },
152+
'ja-JP': { ...en, ...ja },
153+
'ko-KR': { ...en, ...ko },
154+
'ru-RU': { ...en, ...ru },
155+
'th-TH': { ...en, ...th },
156+
'vi-VN': { ...en, ...vi }
59157
}
60158

61-
;['ar-SA', 'de-DE', 'fr-FR', 'ja-JP', 'ko-KR', 'ru-RU', 'th-TH', 'vi-VN'].forEach(code => { messages[code] = { ...en } })
62-
63159
export default messages

‎src/locales/lang/strategy-v2.js‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,12 +2511,31 @@ Object.values(additionalAiContractErrors).forEach(messages => {
25112511
messages['strategyV2.aiHistoryWindowClockUnsupported'] = locale['strategyV2.aiHistoryWindowClockUnsupported']
25122512
})
25132513

2514+
const leverageLimitLocales = {
2515+
'ar-SA': 'لا يمكن أن تتجاوز الرافعة المالية الحد الأقصى {max}x المعلن في مصدر الاستراتيجية.',
2516+
'de-DE': 'Der Hebel darf das im Strategiequelltext angegebene Limit von {max}x nicht überschreiten.',
2517+
'fr-FR': 'L’effet de levier ne peut pas dépasser la limite de {max}x déclarée dans le code source de la stratégie.',
2518+
'ja-JP': 'レバレッジは戦略ソースで宣言された上限 {max} 倍を超えることはできません。',
2519+
'ko-KR': '레버리지는 전략 소스에 선언된 {max}배 한도를 초과할 수 없습니다.',
2520+
'ru-RU': 'Кредитное плечо не может превышать лимит {max}x, указанный в исходном коде стратегии.',
2521+
'th-TH': 'เลเวอเรจต้องไม่เกินขีดจำกัด {max} เท่าที่ประกาศไว้ในซอร์สกลยุทธ์',
2522+
'vi-VN': 'Đòn bẩy không được vượt quá giới hạn {max}x được khai báo trong mã nguồn chiến lược.'
2523+
}
2524+
2525+
Object.entries(leverageLimitLocales).forEach(([localeKey, value]) => {
2526+
additionalAiContractErrors[localeKey]['strategyV2.leverageExceedsStrategyLimit'] = value
2527+
})
2528+
25142529
const deploymentEditorLocales = {
25152530
'ar-SA': {
25162531
sourceChangesHint: 'تُطبَّق تغييرات الأداة والمنتج والإطار الزمني والمعلمات معًا على مصدر الاستراتيجية.',
25172532
applySourceChanges: 'تطبيق على الاستراتيجية وإعادة التجميع',
25182533
sourceChangesApplied: 'تم تحديث الإعدادات الافتراضية لمصدر الاستراتيجية وإعادة تجميعه.',
25192534
sourceChangesApplyFailed: 'تعذر تحديث الإعدادات الافتراضية لمصدر الاستراتيجية.',
2535+
deploymentParametersHint: 'تُحفظ هذه القيم مع هذا التشغيل وتصبح نافذة بعد الإنشاء أو الحفظ. طبّقها على مصدر الاستراتيجية فقط إذا أردت أيضًا تغيير قيمه الافتراضية القابلة لإعادة الاستخدام.',
2536+
applyParametersToSource: 'تطبيق على مصدر الاستراتيجية',
2537+
parametersAppliedToSource: 'تم تحديث المعلمات الافتراضية للاستراتيجية وإعادة تجميعها.',
2538+
parametersApplyFailed: 'تعذر تحديث المعلمات الافتراضية للاستراتيجية.',
25202539
addAccount: 'إضافة حساب',
25212540
paperInitialMargin: 'هامش افتراضي',
25222541
paperInitialCapital: 'رأس مال ابتدائي افتراضي',
@@ -2532,6 +2551,10 @@ const deploymentEditorLocales = {
25322551
applySourceChanges: 'Auf Strategie anwenden und neu kompilieren',
25332552
sourceChangesApplied: 'Die Standardwerte des Strategiequelltexts wurden aktualisiert und neu kompiliert.',
25342553
sourceChangesApplyFailed: 'Die Standardwerte des Strategiequelltexts konnten nicht aktualisiert werden.',
2554+
deploymentParametersHint: 'Diese Werte werden mit diesem Einsatz gespeichert und nach Erstellen oder Speichern wirksam. Wenden Sie sie nur auf den Strategiequelltext an, wenn auch dessen wiederverwendbare Standardwerte geändert werden sollen.',
2555+
applyParametersToSource: 'Auf Strategiequelltext anwenden',
2556+
parametersAppliedToSource: 'Die Standardparameter der Strategie wurden aktualisiert und neu kompiliert.',
2557+
parametersApplyFailed: 'Die Standardparameter der Strategie konnten nicht aktualisiert werden.',
25352558
addAccount: 'Konto hinzufügen',
25362559
paperInitialMargin: 'Virtuelle Margin',
25372560
paperInitialCapital: 'Virtuelles Startkapital',
@@ -2547,6 +2570,10 @@ const deploymentEditorLocales = {
25472570
applySourceChanges: 'Appliquer à la stratégie et recompiler',
25482571
sourceChangesApplied: 'Les valeurs par défaut du code source ont été mises à jour et recompilées.',
25492572
sourceChangesApplyFailed: 'Impossible de mettre à jour les valeurs par défaut du code source.',
2573+
deploymentParametersHint: 'Ces valeurs sont enregistrées avec ce déploiement et prennent effet après sa création ou son enregistrement. Appliquez-les au code source uniquement si vous souhaitez aussi modifier ses valeurs par défaut réutilisables.',
2574+
applyParametersToSource: 'Appliquer au code source de la stratégie',
2575+
parametersAppliedToSource: 'Les paramètres par défaut de la stratégie ont été mis à jour et recompilés.',
2576+
parametersApplyFailed: 'Impossible de mettre à jour les paramètres par défaut de la stratégie.',
25502577
addAccount: 'Ajouter un compte',
25512578
paperInitialMargin: 'Marge virtuelle',
25522579
paperInitialCapital: 'Capital initial virtuel',
@@ -2562,6 +2589,10 @@ const deploymentEditorLocales = {
25622589
applySourceChanges: '戦略に適用して再コンパイル',
25632590
sourceChangesApplied: '戦略ソースの既定値を更新し、再コンパイルしました。',
25642591
sourceChangesApplyFailed: '戦略ソースの既定値を更新できませんでした。',
2592+
deploymentParametersHint: 'これらの値はこのデプロイに保存され、作成または保存後に有効になります。再利用する既定値も変更する場合にのみ、戦略ソースへ適用してください。',
2593+
applyParametersToSource: '戦略ソースに適用',
2594+
parametersAppliedToSource: '戦略の既定パラメータを更新し、再コンパイルしました。',
2595+
parametersApplyFailed: '戦略の既定パラメータを更新できませんでした。',
25652596
addAccount: 'アカウントを追加',
25662597
paperInitialMargin: '仮想証拠金',
25672598
paperInitialCapital: '仮想初期資金',
@@ -2577,6 +2608,10 @@ const deploymentEditorLocales = {
25772608
applySourceChanges: '전략에 적용하고 다시 컴파일',
25782609
sourceChangesApplied: '전략 소스 기본값을 업데이트하고 다시 컴파일했습니다.',
25792610
sourceChangesApplyFailed: '전략 소스 기본값을 업데이트하지 못했습니다.',
2611+
deploymentParametersHint: '이 값은 현재 배포와 함께 저장되며 생성 또는 저장 후 적용됩니다. 재사용 가능한 기본값도 변경하려는 경우에만 전략 소스에 적용하세요.',
2612+
applyParametersToSource: '전략 소스에 적용',
2613+
parametersAppliedToSource: '전략 기본 매개변수를 업데이트하고 다시 컴파일했습니다.',
2614+
parametersApplyFailed: '전략 기본 매개변수를 업데이트하지 못했습니다.',
25802615
addAccount: '계정 추가',
25812616
paperInitialMargin: '가상 증거금',
25822617
paperInitialCapital: '가상 초기 자금',
@@ -2592,6 +2627,10 @@ const deploymentEditorLocales = {
25922627
applySourceChanges: 'Применить к стратегии и перекомпилировать',
25932628
sourceChangesApplied: 'Значения по умолчанию в исходном коде стратегии обновлены и перекомпилированы.',
25942629
sourceChangesApplyFailed: 'Не удалось обновить значения по умолчанию в исходном коде стратегии.',
2630+
deploymentParametersHint: 'Эти значения сохраняются с текущим развёртыванием и вступают в силу после создания или сохранения. Применяйте их к исходному коду стратегии только для изменения её повторно используемых значений по умолчанию.',
2631+
applyParametersToSource: 'Применить к исходному коду стратегии',
2632+
parametersAppliedToSource: 'Параметры стратегии по умолчанию обновлены и перекомпилированы.',
2633+
parametersApplyFailed: 'Не удалось обновить параметры стратегии по умолчанию.',
25952634
addAccount: 'Добавить счёт',
25962635
paperInitialMargin: 'Виртуальная маржа',
25972636
paperInitialCapital: 'Виртуальный начальный капитал',
@@ -2607,6 +2646,10 @@ const deploymentEditorLocales = {
26072646
applySourceChanges: 'นำไปใช้กับกลยุทธ์และคอมไพล์ใหม่',
26082647
sourceChangesApplied: 'อัปเดตค่าเริ่มต้นของซอร์สกลยุทธ์และคอมไพล์ใหม่แล้ว',
26092648
sourceChangesApplyFailed: 'ไม่สามารถอัปเดตค่าเริ่มต้นของซอร์สกลยุทธ์ได้',
2649+
deploymentParametersHint: 'ค่าเหล่านี้จะบันทึกกับการใช้งานครั้งนี้และมีผลหลังจากสร้างหรือบันทึก ให้นำไปใช้กับซอร์สกลยุทธ์เฉพาะเมื่อต้องการเปลี่ยนค่าเริ่มต้นที่นำกลับมาใช้ใหม่ด้วย',
2650+
applyParametersToSource: 'นำไปใช้กับซอร์สกลยุทธ์',
2651+
parametersAppliedToSource: 'อัปเดตพารามิเตอร์เริ่มต้นของกลยุทธ์และคอมไพล์ใหม่แล้ว',
2652+
parametersApplyFailed: 'ไม่สามารถอัปเดตพารามิเตอร์เริ่มต้นของกลยุทธ์ได้',
26102653
addAccount: 'เพิ่มบัญชี',
26112654
paperInitialMargin: 'หลักประกันเสมือน',
26122655
paperInitialCapital: 'เงินทุนเริ่มต้นเสมือน',
@@ -2622,6 +2665,10 @@ const deploymentEditorLocales = {
26222665
applySourceChanges: 'Áp dụng vào chiến lược và biên dịch lại',
26232666
sourceChangesApplied: 'Đã cập nhật các giá trị mặc định của mã nguồn chiến lược và biên dịch lại.',
26242667
sourceChangesApplyFailed: 'Không thể cập nhật các giá trị mặc định của mã nguồn chiến lược.',
2668+
deploymentParametersHint: 'Các giá trị này được lưu cùng lần triển khai và có hiệu lực sau khi tạo hoặc lưu. Chỉ áp dụng chúng vào mã nguồn chiến lược khi bạn cũng muốn thay đổi các giá trị mặc định có thể tái sử dụng.',
2669+
applyParametersToSource: 'Áp dụng vào mã nguồn chiến lược',
2670+
parametersAppliedToSource: 'Đã cập nhật các tham số mặc định của chiến lược và biên dịch lại.',
2671+
parametersApplyFailed: 'Không thể cập nhật các tham số mặc định của chiến lược.',
26252672
addAccount: 'Thêm tài khoản',
26262673
paperInitialMargin: 'Ký quỹ ảo',
26272674
paperInitialCapital: 'Vốn khởi tạo ảo',

0 commit comments

Comments
 (0)