Skip to content

Commit 2b989ea

Browse files
v2.0.5
Signed-off-by: Dinger <quantdinger@gmail.com>
1 parent a4c74b1 commit 2b989ea

18 files changed

Lines changed: 1322 additions & 944 deletions

File tree

README.md

Lines changed: 164 additions & 258 deletions
Large diffs are not rendered by default.

README_CN.md

Lines changed: 166 additions & 254 deletions
Large diffs are not rendered by default.

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId "com.quantdinger.mobile"
1414
minSdkVersion rootProject.ext.minSdkVersion
1515
targetSdkVersion rootProject.ext.targetSdkVersion
16-
versionCode 203
17-
versionName "2.0.3"
16+
versionCode 205
17+
versionName "2.0.5"
1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
aaptOptions {
2020
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "quantdinger-mobile",
33
"private": true,
4-
"version": "2.0.3",
4+
"version": "2.0.5",
55
"license": "SEE LICENSE IN LICENSE",
66
"type": "module",
77
"scripts": {

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const navGroups = computed(() => ([
127127
title: t('sidebar.workspace'),
128128
items: [
129129
{ name: 'ai', label: t('sidebar.ai_analysis'), icon: 'cluster-o', path: '/ai' },
130-
{ name: 'home', label: t('sidebar.market_data'), icon: 'bar-chart-o', path: '/home' },
131130
{ name: 'indicator-market', label: t('sidebar.indicator_market'), icon: 'chart-trending-o', path: '/market' },
132131
{ name: 'create-bot', label: t('sidebar.create_bot'), icon: 'plus', path: '/trading/create' },
133132
{ name: 'trading', label: t('sidebar.strategy_lab'), icon: 'apps-o', path: '/trading' },

src/api/index.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,63 @@ export const klineApi = {
738738

739739
export const aiChatApi = {
740740
sendMessage: (payload) => http.post('/api/ai/chat/message', payload, { timeout: 180000 }),
741+
streamMessage: async (payload, onEvent) => {
742+
const language = payload?.language || 'zh-CN'
743+
const headers = {
744+
'Content-Type': 'application/json',
745+
'Accept-Language': language,
746+
'X-App-Lang': language,
747+
'Cache-Control': 'no-cache'
748+
}
749+
const token = localStorage.getItem('token')
750+
if (token) headers.Authorization = `Bearer ${token}`
751+
752+
const response = await fetch(`${getBaseUrl()}/api/ai/chat/message/stream`, {
753+
method: 'POST',
754+
headers,
755+
credentials: 'include',
756+
body: JSON.stringify(payload)
757+
})
758+
if (!response.ok || !response.body) {
759+
let message = `Stream API ${response.status}`
760+
try {
761+
const errorBody = await response.json()
762+
message = errorBody?.msg || errorBody?.message || message
763+
} catch (_) {}
764+
throw new Error(message)
765+
}
766+
767+
const reader = response.body.getReader()
768+
const decoder = new TextDecoder('utf-8')
769+
let buffer = ''
770+
const handlePart = async (part) => {
771+
const lines = String(part || '').split(/\r?\n/)
772+
let event = 'message'
773+
const dataLines = []
774+
lines.forEach((line) => {
775+
if (line.startsWith('event:')) event = line.slice(6).trim()
776+
else if (line.startsWith('data:')) dataLines.push(line.slice(5).trim())
777+
})
778+
if (!dataLines.length) return
779+
let data = dataLines.join('\n')
780+
try {
781+
data = JSON.parse(data)
782+
} catch (_) {}
783+
if (typeof onEvent === 'function') await onEvent(event, data)
784+
}
785+
786+
while (true) {
787+
const { value, done } = await reader.read()
788+
if (done) break
789+
buffer += decoder.decode(value, { stream: true })
790+
const parts = buffer.split(/\r?\n\r?\n/)
791+
buffer = parts.pop() || ''
792+
for (const part of parts) {
793+
await handlePart(part)
794+
}
795+
}
796+
if (buffer.trim()) await handlePart(buffer)
797+
},
741798
saveLocalMessage: (payload) => http.post('/api/ai/chat/message/local', payload),
742799
getSessions: async (params = {}) => {
743800
const res = await http.get('/api/ai/chat/sessions', { params })

src/locales/en-US.js

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export default {
2929
view_detail: 'Details',
3030
continue: 'Continue',
3131
next_step: 'Next',
32-
previous_step: 'Previous'
32+
previous_step: 'Previous',
33+
press_again_exit: 'Press back again to exit'
3334
},
3435
tabs: {
3536
home: 'Overview',
@@ -212,6 +213,7 @@ export default {
212213
},
213214
trading: {
214215
title: 'Strategies',
216+
stats_entry: 'Stats',
215217
hero_title: 'Automation',
216218
hero_eyebrow: 'Strategy Center',
217219
hero_desc: 'Mobile focuses on monitor & control. Use desktop for orchestration.',
@@ -246,14 +248,14 @@ export default {
246248
create_choice_manual_desc: 'Pick Grid / Martingale / Trend / DCA and fill params',
247249
create_choice_indicator_title: 'From Indicator',
248250
create_choice_indicator_desc: 'Use a purchased or custom indicator',
249-
create_choice_script_title: 'From Script Strategy',
250-
create_choice_script_desc: 'Pick a purchased script strategy from your library, then configure runtime params',
251-
create_choice_preset_title: 'From Bot Preset',
252-
create_choice_preset_desc: 'Pick a purchased preset from your library and tune params before running',
251+
create_choice_script_title: 'From Trading Script',
252+
create_choice_script_desc: 'Pick a purchased trading script from your library, then configure runtime params',
253+
create_choice_preset_title: 'From Strategy Template',
254+
create_choice_preset_desc: 'Pick a purchased strategy template from your library and tune params before running',
253255
create_market_title: 'Create from Strategy Market',
254-
create_market_desc: 'Mobile creates strategies from purchased assets: indicator strategies, script strategies, and bot presets.',
256+
create_market_desc: 'Mobile creates strategies from purchased assets: indicator strategies, trading scripts, and strategy templates.',
255257
create_repository_title: 'Create from My Library',
256-
create_repository_desc: 'Purchased indicators, script strategies and bot presets go into your library first. Pick your own asset, then fill account, symbol and risk parameters.',
258+
create_repository_desc: 'Purchased indicator strategies, trading scripts and strategy templates go into your library first. Pick your own asset, then fill account, symbol and risk parameters.',
257259
create_repository_cta: 'Open My Library',
258260
create_market_cta: 'Go to Strategy Market',
259261
tab_overview: 'Overview',
@@ -586,7 +588,7 @@ export default {
586588
extra_notes_placeholder: 'Optional, e.g. 500 USDT capital, low frequency',
587589
ai_default_prompt:
588590
'Recommend a suitable quant trading bot for {symbol}. Risk: {risk}; market view: {market}; initial capital about {capital} USDT.',
589-
ai_script_title: 'AI script strategy',
591+
ai_script_title: 'AI trading script',
590592
ai_script_default_name: 'AI grid script',
591593
ai_script_preview: 'Code preview',
592594
apply_ai_script: 'Create with this script',
@@ -620,6 +622,8 @@ export default {
620622
filter_all: 'All',
621623
filter_free: 'Free',
622624
filter_paid: 'Paid',
625+
filter_vip_free: 'VIP Free',
626+
vip_free: 'VIP Free',
623627
sort_newest: 'Newest',
624628
sort_hot: 'Hot',
625629
sort_score: 'Top picks',
@@ -635,14 +639,14 @@ export default {
635639
detail_use: 'Create strategy',
636640
detail_price: 'Price',
637641
asset_indicator: 'Indicator Strategy',
638-
asset_script_template: 'Script Strategy',
639-
asset_bot_preset: 'Bot Preset',
642+
asset_script_template: 'Trading Script',
643+
asset_bot_preset: 'Strategy Template',
640644
asset_indicator_desc: 'Buy an indicator and create a live or signal strategy from it.',
641-
asset_script_template_desc: 'Buy a script template, then configure account, symbol and risk on mobile.',
642-
asset_bot_preset_desc: 'Buy a ready-made bot preset and tune its parameters before running.',
645+
asset_script_template_desc: 'Buy a trading script, then configure account, symbol and risk on mobile.',
646+
asset_bot_preset_desc: 'Buy a strategy template and tune its parameters before running.',
643647
use_indicator: 'Create indicator strategy',
644-
use_script_template: 'Configure script strategy',
645-
use_bot_preset: 'Configure preset',
648+
use_script_template: 'Configure trading script',
649+
use_bot_preset: 'Configure template',
646650
detail_about: 'About',
647651
detail_reviews: 'Reviews',
648652
detail_performance: 'Live Performance',
@@ -668,13 +672,20 @@ export default {
668672
purchase_confirm_desc: 'This will cost {price} credits. The indicator will be copied to your account.',
669673
purchase_success: 'Purchased',
670674
purchase_fail: 'Purchase failed',
671-
insufficient_credits: 'Insufficient credits'
675+
insufficient_credits: 'Insufficient credits',
676+
sync_code: 'Sync code',
677+
sync_code_confirm_title: 'Sync latest code?',
678+
sync_code_confirm_desc: 'Your local purchased copy will be updated from the publisher. Existing strategy runtime parameters will be kept.',
679+
sync_success: 'Code synced',
680+
sync_restored: 'Local copy restored',
681+
sync_already_latest: 'Already up to date',
682+
sync_fail: 'Sync failed'
672683
},
673684
script_strategy: {
674-
title: 'Script Strategy',
675-
source_label: 'Purchased script template',
676-
source_missing: 'Script template was not synced locally. Please purchase or sync it again.',
677-
untitled: 'Untitled Script',
685+
title: 'Trading Script',
686+
source_label: 'Purchased trading script',
687+
source_missing: 'Trading script was not synced locally. Please purchase or sync it again.',
688+
untitled: 'Untitled Trading Script',
678689
desc: 'The source code stays in your purchased script library. Mobile only configures runtime settings.'
679690
},
680691
indicator_bot: {
@@ -803,7 +814,7 @@ export default {
803814
about: {
804815
title: 'About',
805816
intro:
806-
'QuantDinger brings together strategy tools, market data and portfolio workflows. We aim to provide transparent trading assistance. Digital asset trading involves substantial risk—please use the product only after you understand the features and exchange rules.',
817+
'QuantDinger is an AI-assisted trading system for market research and automated execution, covering market analysis, strategy management, trade execution, and asset tracking. Its outputs are for research and decision support only and do not constitute investment advice. Markets involve risk; use the product with care and your own judgment.',
807818
contact_title: 'Contact',
808819
contact_email_label: 'Support email',
809820
website_label: 'Official website',

src/locales/ja-JP.js

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export default {
2929
view_detail: '詳細',
3030
continue: '続ける',
3131
next_step: '次へ',
32-
previous_step: '前へ'
32+
previous_step: '前へ',
33+
press_again_exit: 'もう一度戻るを押すとアプリを終了します'
3334
},
3435
tabs: {
3536
home: 'ホーム',
@@ -211,13 +212,14 @@ export default {
211212
watchlist_empty_desc: '銘柄を追加して価格をフォロー、即取引しましょう'
212213
},
213214
trading: {
214-
create_market_desc: 'モバイルでは購入済みの指標戦略、スクリプト戦略、ボットプリセットから作成します。',
215+
create_market_desc: 'モバイルでは購入済みの指標戦略、取引スクリプト、戦略テンプレートから作成します。',
215216
create_market_title: 'ストラテジーマーケットから作成',
216217
create_repository_title: 'マイライブラリから戦略を作成',
217-
create_repository_desc: '購入したインジケーター、スクリプト戦略、ボットプリセットは先にライブラリへ保存されます。作成時は自分の資産を選び、口座・銘柄・リスク設定を入力します。',
218+
create_repository_desc: '購入した指標戦略、取引スクリプト、戦略テンプレートは先にライブラリへ保存されます。作成時は自分の資産を選び、口座・銘柄・リスク設定を入力します。',
218219
create_repository_cta: 'マイライブラリを見る',
219220
create_market_cta: '戦略マーケットへ',
220221
title: '戦略',
222+
stats_entry: '統計',
221223
hero_title: '自動化',
222224
hero_eyebrow: '戦略センター',
223225
hero_desc: 'モバイルはモニタリングと制御に特化。詳細設定は PC で行ってください。',
@@ -252,10 +254,10 @@ export default {
252254
create_choice_manual_desc: 'グリッド/マーチン/トレンド/DCA を選択してパラメータを入力',
253255
create_choice_indicator_title: 'インジケーターから作成',
254256
create_choice_indicator_desc: '購入済みまたは自作のインジケーターを使用',
255-
create_choice_script_title: 'スクリプト戦略から作成',
256-
create_choice_script_desc: 'マイライブラリの購入済みスクリプト戦略を選び、実行パラメータを設定',
257-
create_choice_preset_title: 'ボットプリセットから作成',
258-
create_choice_preset_desc: 'マイライブラリの購入済みプリセットを選び、調整して実行',
257+
create_choice_script_title: '取引スクリプトから作成',
258+
create_choice_script_desc: 'マイライブラリの購入済み取引スクリプトを選び、実行パラメータを設定',
259+
create_choice_preset_title: '戦略テンプレートから作成',
260+
create_choice_preset_desc: 'マイライブラリの購入済み戦略テンプレートを選び、調整して実行',
259261
tab_overview: '概要',
260262
tab_params: 'パラメータ',
261263
tab_positions: 'ポジション',
@@ -587,7 +589,7 @@ export default {
587589
extra_notes_placeholder: '任意。例:資金 500 USDT、低頻度',
588590
ai_default_prompt:
589591
'{symbol} に適したクオンツボットを提案してください。リスク:{risk}、相場観:{market}、投入資金:約 {capital} USDT。',
590-
ai_script_title: 'AI スクリプト戦略',
592+
ai_script_title: 'AI 取引スクリプト',
591593
ai_script_default_name: 'AI グリッド スクリプト',
592594
ai_script_preview: 'コード プレビュー',
593595
apply_ai_script: 'このスクリプトで作成',
@@ -614,14 +616,14 @@ export default {
614616
update_fail: '更新に失敗しました'
615617
},
616618
market: {
617-
use_bot_preset: 'プリセットを設定',
618-
use_script_template: 'スクリプト戦略を設定',
619+
use_bot_preset: 'テンプレートを設定',
620+
use_script_template: '取引スクリプトを設定',
619621
use_indicator: '指標戦略を作成',
620-
asset_bot_preset_desc: '既成のボットプリセットを購入し、パラメータを調整して実行します。',
621-
asset_script_template_desc: 'スクリプトテンプレートを購入し、モバイルで口座・銘柄・リスクを設定します。',
622+
asset_bot_preset_desc: '戦略テンプレートを購入し、パラメータを調整して実行します。',
623+
asset_script_template_desc: '取引スクリプトを購入し、モバイルで口座・銘柄・リスクを設定します。',
622624
asset_indicator_desc: '指標を購入し、ライブまたはシグナル戦略を作成します。',
623-
asset_bot_preset: 'ボットプリセット',
624-
asset_script_template: 'スクリプト戦略',
625+
asset_bot_preset: '戦略テンプレート',
626+
asset_script_template: '取引スクリプト',
625627
asset_indicator: '指標戦略',
626628
detail_price: '価格',
627629
title: '戦略マーケット',
@@ -630,6 +632,8 @@ export default {
630632
filter_all: 'すべて',
631633
filter_free: '無料',
632634
filter_paid: '有料',
635+
filter_vip_free: 'VIP無料',
636+
vip_free: 'VIP無料',
633637
sort_newest: '新着',
634638
sort_hot: '人気',
635639
sort_score: 'おすすめ',
@@ -668,13 +672,20 @@ export default {
668672
purchase_confirm_desc: '{price} クレジットで購入します。インジケーターはアカウントにコピーされます。',
669673
purchase_success: '購入完了',
670674
purchase_fail: '購入に失敗しました',
671-
insufficient_credits: 'クレジットが不足しています'
675+
insufficient_credits: 'クレジットが不足しています',
676+
sync_code: 'コード同期',
677+
sync_code_confirm_title: '最新コードに同期しますか?',
678+
sync_code_confirm_desc: '購入済みのローカルコピーを公開者の最新バージョンで更新します。作成済み戦略の実行パラメータは保持されます。',
679+
sync_success: 'コードを同期しました',
680+
sync_restored: 'ローカルコピーを復元しました',
681+
sync_already_latest: 'すでに最新です',
682+
sync_fail: '同期に失敗しました'
672683
},
673684
script_strategy: {
674-
title: 'スクリプト戦略',
675-
source_label: '購入済みスクリプトテンプレート',
676-
source_missing: 'スクリプトテンプレートがローカルに同期されていません。再購入または同期してください。',
677-
untitled: '無題のスクリプト',
685+
title: '取引スクリプト',
686+
source_label: '購入済み取引スクリプト',
687+
source_missing: '取引スクリプトがローカルに同期されていません。再購入または同期してください。',
688+
untitled: '無題の取引スクリプト',
678689
desc: 'ソースコードは購入済みスクリプトライブラリに保存され、モバイルでは実行設定のみ行います。',
679690
},
680691
indicator_bot: {
@@ -741,6 +752,7 @@ export default {
741752
manage_credentials: 'API Key 管理',
742753
account: '取引所アカウント',
743754
no_credential: '先に API Key を追加してください',
755+
no_crypto_credential: 'クイック取引は現在、暗号資産取引所の API Key のみ対応しています。',
744756
pick_credential: '保存済み API Key を選択',
745757
market_type: '市場',
746758
market_spot: '現物',

0 commit comments

Comments
 (0)