@backtest-kit/ui 12.8.0 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +254 -254
- package/build/index.cjs +575 -0
- package/build/index.mjs +576 -1
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/ace.js +21337 -21337
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/mode-javascript.js +797 -797
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/theme-chrome.js +137 -137
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/theme-twilight.js +115 -115
- package/build/modules/frontend/build/3rdparty/ace_1.4.12/worker-javascript.js +15012 -15012
- package/build/modules/frontend/build/3rdparty/qfchart_0.8.7/echarts.min.js +45 -45
- package/build/modules/frontend/build/assets/{Article-Da78GEhK.js → Article-sbYRbQe0.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-0ACHD5B6.js → Background-dyHMipOI.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-BPAbqALJ.js → IconPhoto-CHqApvRw.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-YMeBM3Q3.js → KeyboardArrowLeft-CHOMu6qx.js} +1 -1
- package/build/modules/frontend/build/assets/{PictureAsPdfOutlined-CA7hIpf4.js → PictureAsPdfOutlined-DzknxeSi.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-CTa-W1su.js → Refresh-DmSh3yQM.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-BNMcCjB_.js +1 -0
- package/build/modules/frontend/build/assets/{hasRouteMatch-Dz1eRfX0.js → hasRouteMatch-DqwdOTLY.js} +1 -1
- package/build/modules/frontend/build/assets/{html2canvas-CuvtHslW.js → html2canvas-CHKh6bmw.js} +1 -1
- package/build/modules/frontend/build/assets/{index-fv31BaKN.js → index-0MseBgyH.js} +15 -15
- package/build/modules/frontend/build/assets/{index-jg7SuL7J.js → index-9MTo_fXC.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Dye20IcA.js → index-BGUfC2GH.js} +1 -1
- package/build/modules/frontend/build/assets/index-BkciU9PY.js +1 -0
- package/build/modules/frontend/build/assets/{index-C0qezHrv.js → index-Bm2KpX4M.js} +1 -1
- package/build/modules/frontend/build/assets/{index-tg1njHyT.js → index-COEOSThW.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CGTByLJp.js → index-C_bLqeg4.js} +1 -1
- package/build/modules/frontend/build/assets/{index-C19KVXyR.js → index-CkS6tnju.js} +1 -1
- package/build/modules/frontend/build/assets/index-DUb1EyrG.js +1 -0
- package/build/modules/frontend/build/assets/{index--CAl9k-j.js → index-DYoETulh.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DO3lwaMI.js → index-Dq8WsVMT.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DCkqZSEX.js → index-DrklJPOF.js} +1 -1
- package/build/modules/frontend/build/assets/index-DtlxmULa.js +1 -0
- package/build/modules/frontend/build/assets/{index.es-DtUP6yiZ.js → index.es-Bnd2KFus.js} +2 -2
- package/build/modules/frontend/build/assets/{markdownit-Bj4vpJSk.js → markdownit-CWkrj-EI.js} +1 -1
- package/build/modules/frontend/build/index.html +87 -87
- package/build/modules/frontend/build/manifest.json +23 -23
- package/package.json +118 -118
- package/types.d.ts +85 -0
- package/build/modules/frontend/build/assets/emitters-CwOzUPwS.js +0 -1
- package/build/modules/frontend/build/assets/index-C5c7YQ-Q.js +0 -1
- package/build/modules/frontend/build/assets/index-CgLCD4kl.js +0 -1
- package/build/modules/frontend/build/assets/index-EnF3Est3.js +0 -1
package/build/modules/frontend/build/assets/{markdownit-Bj4vpJSk.js → markdownit-CWkrj-EI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bM as e,bN as t}from"./index-0MseBgyH.js";function r(e,t){for(var r=0;r<t.length;r++){const o=t[r];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(o,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=t();const n=r({__proto__:null,default:e(o)},[o]);export{n as m};
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="ru" translate="no">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<title>BacktestKit</title>
|
|
6
|
-
<meta
|
|
7
|
-
name="viewport"
|
|
8
|
-
content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimal-ui"
|
|
9
|
-
/>
|
|
10
|
-
<link rel="stylesheet" href="/3rdparty/typeface-roboto_0.0.75/typeface-roboto.css" />
|
|
11
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
|
12
|
-
<meta name="apple-mobile-web-app-title" content="BacktestKit" />
|
|
13
|
-
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
14
|
-
<meta name="mobile-web-app-capable" content="yes" />
|
|
15
|
-
<script src="/3rdparty/ace_1.4.12/ace.js"></script>
|
|
16
|
-
<script src="/3rdparty/ace_1.4.12/mode-javascript.js"></script>
|
|
17
|
-
<script src="/3rdparty/ace_1.4.12/theme-twilight.js"></script>
|
|
18
|
-
<script src="/3rdparty/ace_1.4.12/theme-chrome.js"></script>
|
|
19
|
-
<script src="/3rdparty/ace_1.4.12/worker-javascript.js"></script>
|
|
20
|
-
<script src="/3rdparty/qfchart_0.8.7/echarts.min.js"></script>
|
|
21
|
-
<script src="/3rdparty/qfchart_0.8.7/qfchart.js"></script>
|
|
22
|
-
<script src="/3rdparty/qfchart_0.8.7/pinets.js"></script>
|
|
23
|
-
<link
|
|
24
|
-
rel="apple-touch-icon"
|
|
25
|
-
sizes="512x512"
|
|
26
|
-
href="/logo/icon512_maskable.png"
|
|
27
|
-
/>
|
|
28
|
-
<link
|
|
29
|
-
rel="icon"
|
|
30
|
-
type="image/png"
|
|
31
|
-
sizes="512x512"
|
|
32
|
-
href="/logo/icon512_maskable.png"
|
|
33
|
-
/>
|
|
34
|
-
<link rel="manifest" href="/manifest.json" />
|
|
35
|
-
<link
|
|
36
|
-
rel="prefetch"
|
|
37
|
-
href="/images/cubes.png"
|
|
38
|
-
as="image"
|
|
39
|
-
type="image/png"
|
|
40
|
-
/>
|
|
41
|
-
<link
|
|
42
|
-
rel="prefetch"
|
|
43
|
-
href="/images/snow.png"
|
|
44
|
-
as="image"
|
|
45
|
-
type="image/png"
|
|
46
|
-
/>
|
|
47
|
-
<link
|
|
48
|
-
rel="prefetch"
|
|
49
|
-
href="/images/square.png"
|
|
50
|
-
as="image"
|
|
51
|
-
type="image/png"
|
|
52
|
-
/>
|
|
53
|
-
<link
|
|
54
|
-
rel="prefetch"
|
|
55
|
-
href="/images/triangle.png"
|
|
56
|
-
as="image"
|
|
57
|
-
type="image/png"
|
|
58
|
-
/>
|
|
59
|
-
<link
|
|
60
|
-
rel="prefetch"
|
|
61
|
-
href="/images/dots.png"
|
|
62
|
-
as="image"
|
|
63
|
-
type="image/png"
|
|
64
|
-
/>
|
|
65
|
-
<link
|
|
66
|
-
rel="prefetch"
|
|
67
|
-
href="/logo/icon512_maskable.png"
|
|
68
|
-
as="image/png"
|
|
69
|
-
/>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="ru" translate="no">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>BacktestKit</title>
|
|
6
|
+
<meta
|
|
7
|
+
name="viewport"
|
|
8
|
+
content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimal-ui"
|
|
9
|
+
/>
|
|
10
|
+
<link rel="stylesheet" href="/3rdparty/typeface-roboto_0.0.75/typeface-roboto.css" />
|
|
11
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
|
12
|
+
<meta name="apple-mobile-web-app-title" content="BacktestKit" />
|
|
13
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
14
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
15
|
+
<script src="/3rdparty/ace_1.4.12/ace.js"></script>
|
|
16
|
+
<script src="/3rdparty/ace_1.4.12/mode-javascript.js"></script>
|
|
17
|
+
<script src="/3rdparty/ace_1.4.12/theme-twilight.js"></script>
|
|
18
|
+
<script src="/3rdparty/ace_1.4.12/theme-chrome.js"></script>
|
|
19
|
+
<script src="/3rdparty/ace_1.4.12/worker-javascript.js"></script>
|
|
20
|
+
<script src="/3rdparty/qfchart_0.8.7/echarts.min.js"></script>
|
|
21
|
+
<script src="/3rdparty/qfchart_0.8.7/qfchart.js"></script>
|
|
22
|
+
<script src="/3rdparty/qfchart_0.8.7/pinets.js"></script>
|
|
23
|
+
<link
|
|
24
|
+
rel="apple-touch-icon"
|
|
25
|
+
sizes="512x512"
|
|
26
|
+
href="/logo/icon512_maskable.png"
|
|
27
|
+
/>
|
|
28
|
+
<link
|
|
29
|
+
rel="icon"
|
|
30
|
+
type="image/png"
|
|
31
|
+
sizes="512x512"
|
|
32
|
+
href="/logo/icon512_maskable.png"
|
|
33
|
+
/>
|
|
34
|
+
<link rel="manifest" href="/manifest.json" />
|
|
35
|
+
<link
|
|
36
|
+
rel="prefetch"
|
|
37
|
+
href="/images/cubes.png"
|
|
38
|
+
as="image"
|
|
39
|
+
type="image/png"
|
|
40
|
+
/>
|
|
41
|
+
<link
|
|
42
|
+
rel="prefetch"
|
|
43
|
+
href="/images/snow.png"
|
|
44
|
+
as="image"
|
|
45
|
+
type="image/png"
|
|
46
|
+
/>
|
|
47
|
+
<link
|
|
48
|
+
rel="prefetch"
|
|
49
|
+
href="/images/square.png"
|
|
50
|
+
as="image"
|
|
51
|
+
type="image/png"
|
|
52
|
+
/>
|
|
53
|
+
<link
|
|
54
|
+
rel="prefetch"
|
|
55
|
+
href="/images/triangle.png"
|
|
56
|
+
as="image"
|
|
57
|
+
type="image/png"
|
|
58
|
+
/>
|
|
59
|
+
<link
|
|
60
|
+
rel="prefetch"
|
|
61
|
+
href="/images/dots.png"
|
|
62
|
+
as="image"
|
|
63
|
+
type="image/png"
|
|
64
|
+
/>
|
|
65
|
+
<link
|
|
66
|
+
rel="prefetch"
|
|
67
|
+
href="/logo/icon512_maskable.png"
|
|
68
|
+
as="image/png"
|
|
69
|
+
/>
|
|
70
70
|
<style>
|
|
71
71
|
html,
|
|
72
72
|
body {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
scrollbar-width: none;
|
|
79
79
|
background: #eee !important;
|
|
80
80
|
}
|
|
81
|
-
</style>
|
|
81
|
+
</style>
|
|
82
82
|
<style>
|
|
83
83
|
.loader_wraper {
|
|
84
84
|
display: flex;
|
|
@@ -143,21 +143,21 @@
|
|
|
143
143
|
* {
|
|
144
144
|
font-family: "Roboto", sans-serif !important;
|
|
145
145
|
}
|
|
146
|
-
</style>
|
|
147
|
-
<link
|
|
148
|
-
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
|
|
149
|
-
rel="stylesheet"
|
|
150
|
-
/>
|
|
151
|
-
<script type="module" crossorigin src="/assets/index-
|
|
146
|
+
</style>
|
|
147
|
+
<link
|
|
148
|
+
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
|
|
149
|
+
rel="stylesheet"
|
|
150
|
+
/>
|
|
151
|
+
<script type="module" crossorigin src="/assets/index-0MseBgyH.js"></script>
|
|
152
152
|
<link rel="stylesheet" crossorigin href="/assets/index-DrRm3Jka.css">
|
|
153
|
-
</head>
|
|
154
|
-
|
|
155
|
-
<body>
|
|
156
|
-
<div id="root">
|
|
157
|
-
<div class="loader_wraper">
|
|
158
|
-
<div class="loader"></div>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
162
|
-
</body>
|
|
163
|
-
</html>
|
|
153
|
+
</head>
|
|
154
|
+
|
|
155
|
+
<body>
|
|
156
|
+
<div id="root">
|
|
157
|
+
<div class="loader_wraper">
|
|
158
|
+
<div class="loader"></div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
162
|
+
</body>
|
|
163
|
+
</html>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "BacktestKit",
|
|
3
|
-
"theme_color": "#6974b0",
|
|
4
|
-
"background_color": "#6974b0",
|
|
5
|
-
"icons": [
|
|
6
|
-
{
|
|
7
|
-
"purpose": "maskable",
|
|
8
|
-
"sizes": "512x512",
|
|
9
|
-
"src": "/logo/icon512_maskable.png",
|
|
10
|
-
"type": "image/png"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"purpose": "any",
|
|
14
|
-
"sizes": "512x512",
|
|
15
|
-
"src": "/logo/icon512_rounded.png",
|
|
16
|
-
"type": "image/png"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"orientation": "any",
|
|
20
|
-
"display": "standalone",
|
|
21
|
-
"dir": "ltr",
|
|
22
|
-
"lang": "ru-RU"
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "BacktestKit",
|
|
3
|
+
"theme_color": "#6974b0",
|
|
4
|
+
"background_color": "#6974b0",
|
|
5
|
+
"icons": [
|
|
6
|
+
{
|
|
7
|
+
"purpose": "maskable",
|
|
8
|
+
"sizes": "512x512",
|
|
9
|
+
"src": "/logo/icon512_maskable.png",
|
|
10
|
+
"type": "image/png"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"purpose": "any",
|
|
14
|
+
"sizes": "512x512",
|
|
15
|
+
"src": "/logo/icon512_rounded.png",
|
|
16
|
+
"type": "image/png"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"orientation": "any",
|
|
20
|
+
"display": "standalone",
|
|
21
|
+
"dir": "ltr",
|
|
22
|
+
"lang": "ru-RU"
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@backtest-kit/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. React dashboard with candlestick charts, signal tracking, and risk analysis.",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Petr Tripolsky",
|
|
7
|
-
"email": "tripolskypetr@gmail.com",
|
|
8
|
-
"url": "https://github.com/tripolskypetr"
|
|
9
|
-
},
|
|
10
|
-
"funding": {
|
|
11
|
-
"type": "individual",
|
|
12
|
-
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"backtest",
|
|
18
|
-
"backtesting",
|
|
19
|
-
"trading",
|
|
20
|
-
"crypto",
|
|
21
|
-
"cryptocurrency",
|
|
22
|
-
"bitcoin",
|
|
23
|
-
"ethereum",
|
|
24
|
-
"dashboard",
|
|
25
|
-
"ui",
|
|
26
|
-
"react",
|
|
27
|
-
"material-ui",
|
|
28
|
-
"mui",
|
|
29
|
-
"charts",
|
|
30
|
-
"candlestick",
|
|
31
|
-
"lightweight-charts",
|
|
32
|
-
"signals",
|
|
33
|
-
"trading-signals",
|
|
34
|
-
"risk-management",
|
|
35
|
-
"ccxt",
|
|
36
|
-
"binance",
|
|
37
|
-
"exchange",
|
|
38
|
-
"visualization",
|
|
39
|
-
"trading-bot",
|
|
40
|
-
"algo-trading",
|
|
41
|
-
"algorithmic-trading",
|
|
42
|
-
"quantitative-trading"
|
|
43
|
-
],
|
|
44
|
-
"files": [
|
|
45
|
-
"build",
|
|
46
|
-
"types.d.ts",
|
|
47
|
-
"README.md"
|
|
48
|
-
],
|
|
49
|
-
"repository": {
|
|
50
|
-
"type": "git",
|
|
51
|
-
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
52
|
-
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
53
|
-
},
|
|
54
|
-
"bugs": {
|
|
55
|
-
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"start": "npm run build && cross-env NODE_ENV=development CC_ENABLE_MOCK=1 npm run serve",
|
|
59
|
-
"serve": "node ./scripts/mock.mjs",
|
|
60
|
-
"build:modules": "npm run build:modules:win",
|
|
61
|
-
"build:modules:win": "dotenv -e .env -- .\\scripts\\win\\build.bat && npm run build:copy && npm run build:postbuild",
|
|
62
|
-
"build:modules:x": "dotenv -e .env -- sh ./scripts/linux/build.sh && npm run build:copy && npm run build:postbuild",
|
|
63
|
-
"build:copy": "node ./scripts/copy.mjs",
|
|
64
|
-
"build:postbuild": "node ./scripts/postbuild.mjs",
|
|
65
|
-
"build": "rollup -c"
|
|
66
|
-
},
|
|
67
|
-
"main": "build/index.cjs",
|
|
68
|
-
"module": "build/index.mjs",
|
|
69
|
-
"source": "src/index.ts",
|
|
70
|
-
"types": "./types.d.ts",
|
|
71
|
-
"exports": {
|
|
72
|
-
"require": "./build/index.cjs",
|
|
73
|
-
"types": "./types.d.ts",
|
|
74
|
-
"import": "./build/index.mjs",
|
|
75
|
-
"default": "./build/index.cjs"
|
|
76
|
-
},
|
|
77
|
-
"devDependencies": {
|
|
78
|
-
"@rollup/plugin-typescript": "11.1.6",
|
|
79
|
-
"@rollup/plugin-terser": "0.4.4",
|
|
80
|
-
"@types/finalhandler": "1.2.3",
|
|
81
|
-
"@types/serve-handler": "6.1.4",
|
|
82
|
-
"cross-env": "7.0.3",
|
|
83
|
-
"@types/node": "22.9.0",
|
|
84
|
-
"glob": "11.0.1",
|
|
85
|
-
"rimraf": "6.0.1",
|
|
86
|
-
"rollup": "3.29.5",
|
|
87
|
-
"rollup-plugin-dts": "6.1.1",
|
|
88
|
-
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
89
|
-
"ts-morph": "27.0.2",
|
|
90
|
-
"tslib": "2.7.0",
|
|
91
|
-
"typedoc": "0.27.9",
|
|
92
|
-
"ccxt": "4.5.24",
|
|
93
|
-
"touch": "3.1.1",
|
|
94
|
-
"worker-testbed": "2.0.0",
|
|
95
|
-
"backtest-kit": "
|
|
96
|
-
"markdown-it": "14.1.0"
|
|
97
|
-
},
|
|
98
|
-
"peerDependencies": {
|
|
99
|
-
"backtest-kit": "^
|
|
100
|
-
"markdown-it": "^14.1.0",
|
|
101
|
-
"ccxt": "^4.5.24",
|
|
102
|
-
"typescript": "^5.0.0"
|
|
103
|
-
},
|
|
104
|
-
"dependencies": {
|
|
105
|
-
"di-kit": "^1.1.1",
|
|
106
|
-
"di-scoped": "^1.0.21",
|
|
107
|
-
"functools-kit": "^2.3.0",
|
|
108
|
-
"get-moment-stamp": "^2.0.0",
|
|
109
|
-
"finalhandler": "^1.3.1",
|
|
110
|
-
"serve-handler": "^6.1.6",
|
|
111
|
-
"cryptocurrency-icons": "^0.18.1",
|
|
112
|
-
"router": "^1.3.8",
|
|
113
|
-
"micro": "^10.0.1"
|
|
114
|
-
},
|
|
115
|
-
"publishConfig": {
|
|
116
|
-
"access": "public"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@backtest-kit/ui",
|
|
3
|
+
"version": "13.3.0",
|
|
4
|
+
"description": "Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. React dashboard with candlestick charts, signal tracking, and risk analysis.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Petr Tripolsky",
|
|
7
|
+
"email": "tripolskypetr@gmail.com",
|
|
8
|
+
"url": "https://github.com/tripolskypetr"
|
|
9
|
+
},
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "individual",
|
|
12
|
+
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"backtest",
|
|
18
|
+
"backtesting",
|
|
19
|
+
"trading",
|
|
20
|
+
"crypto",
|
|
21
|
+
"cryptocurrency",
|
|
22
|
+
"bitcoin",
|
|
23
|
+
"ethereum",
|
|
24
|
+
"dashboard",
|
|
25
|
+
"ui",
|
|
26
|
+
"react",
|
|
27
|
+
"material-ui",
|
|
28
|
+
"mui",
|
|
29
|
+
"charts",
|
|
30
|
+
"candlestick",
|
|
31
|
+
"lightweight-charts",
|
|
32
|
+
"signals",
|
|
33
|
+
"trading-signals",
|
|
34
|
+
"risk-management",
|
|
35
|
+
"ccxt",
|
|
36
|
+
"binance",
|
|
37
|
+
"exchange",
|
|
38
|
+
"visualization",
|
|
39
|
+
"trading-bot",
|
|
40
|
+
"algo-trading",
|
|
41
|
+
"algorithmic-trading",
|
|
42
|
+
"quantitative-trading"
|
|
43
|
+
],
|
|
44
|
+
"files": [
|
|
45
|
+
"build",
|
|
46
|
+
"types.d.ts",
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
52
|
+
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
53
|
+
},
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"start": "npm run build && cross-env NODE_ENV=development CC_ENABLE_MOCK=1 npm run serve",
|
|
59
|
+
"serve": "node ./scripts/mock.mjs",
|
|
60
|
+
"build:modules": "npm run build:modules:win",
|
|
61
|
+
"build:modules:win": "dotenv -e .env -- .\\scripts\\win\\build.bat && npm run build:copy && npm run build:postbuild",
|
|
62
|
+
"build:modules:x": "dotenv -e .env -- sh ./scripts/linux/build.sh && npm run build:copy && npm run build:postbuild",
|
|
63
|
+
"build:copy": "node ./scripts/copy.mjs",
|
|
64
|
+
"build:postbuild": "node ./scripts/postbuild.mjs",
|
|
65
|
+
"build": "rollup -c"
|
|
66
|
+
},
|
|
67
|
+
"main": "build/index.cjs",
|
|
68
|
+
"module": "build/index.mjs",
|
|
69
|
+
"source": "src/index.ts",
|
|
70
|
+
"types": "./types.d.ts",
|
|
71
|
+
"exports": {
|
|
72
|
+
"require": "./build/index.cjs",
|
|
73
|
+
"types": "./types.d.ts",
|
|
74
|
+
"import": "./build/index.mjs",
|
|
75
|
+
"default": "./build/index.cjs"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
79
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
80
|
+
"@types/finalhandler": "1.2.3",
|
|
81
|
+
"@types/serve-handler": "6.1.4",
|
|
82
|
+
"cross-env": "7.0.3",
|
|
83
|
+
"@types/node": "22.9.0",
|
|
84
|
+
"glob": "11.0.1",
|
|
85
|
+
"rimraf": "6.0.1",
|
|
86
|
+
"rollup": "3.29.5",
|
|
87
|
+
"rollup-plugin-dts": "6.1.1",
|
|
88
|
+
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
89
|
+
"ts-morph": "27.0.2",
|
|
90
|
+
"tslib": "2.7.0",
|
|
91
|
+
"typedoc": "0.27.9",
|
|
92
|
+
"ccxt": "4.5.24",
|
|
93
|
+
"touch": "3.1.1",
|
|
94
|
+
"worker-testbed": "2.0.0",
|
|
95
|
+
"backtest-kit": "13.3.0",
|
|
96
|
+
"markdown-it": "14.1.0"
|
|
97
|
+
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"backtest-kit": "^13.3.0",
|
|
100
|
+
"markdown-it": "^14.1.0",
|
|
101
|
+
"ccxt": "^4.5.24",
|
|
102
|
+
"typescript": "^5.0.0"
|
|
103
|
+
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"di-kit": "^1.1.1",
|
|
106
|
+
"di-scoped": "^1.0.21",
|
|
107
|
+
"functools-kit": "^2.3.0",
|
|
108
|
+
"get-moment-stamp": "^2.0.0",
|
|
109
|
+
"finalhandler": "^1.3.1",
|
|
110
|
+
"serve-handler": "^6.1.6",
|
|
111
|
+
"cryptocurrency-icons": "^0.18.1",
|
|
112
|
+
"router": "^1.3.8",
|
|
113
|
+
"micro": "^10.0.1"
|
|
114
|
+
},
|
|
115
|
+
"publishConfig": {
|
|
116
|
+
"access": "public"
|
|
117
|
+
}
|
|
118
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -453,6 +453,89 @@ declare class RuntimeViewService {
|
|
|
453
453
|
getRuntimeInfo: () => Promise<IRuntimeInfo>;
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
+
declare class ControlViewService {
|
|
457
|
+
private readonly loggerService;
|
|
458
|
+
private readonly controlMockService;
|
|
459
|
+
getStatus: (symbol: string, context: {
|
|
460
|
+
strategyName: string;
|
|
461
|
+
exchangeName: string;
|
|
462
|
+
}) => Promise<{
|
|
463
|
+
strategyInfo: any;
|
|
464
|
+
pendingSignal: any;
|
|
465
|
+
currentPrice: any;
|
|
466
|
+
}>;
|
|
467
|
+
getAveragePrice: (symbol: string, context: {
|
|
468
|
+
strategyName: string;
|
|
469
|
+
exchangeName: string;
|
|
470
|
+
}) => Promise<number>;
|
|
471
|
+
commitOpenPending: (symbol: string, context: {
|
|
472
|
+
strategyName: string;
|
|
473
|
+
exchangeName: string;
|
|
474
|
+
}, dto: {
|
|
475
|
+
position: "long" | "short";
|
|
476
|
+
cost: number;
|
|
477
|
+
note: string;
|
|
478
|
+
}) => Promise<void>;
|
|
479
|
+
commitAverageBuy: (symbol: string, context: {
|
|
480
|
+
strategyName: string;
|
|
481
|
+
exchangeName: string;
|
|
482
|
+
}, dto: {
|
|
483
|
+
cost: number;
|
|
484
|
+
note: string;
|
|
485
|
+
}) => Promise<void>;
|
|
486
|
+
commitClosePending: (symbol: string, context: {
|
|
487
|
+
strategyName: string;
|
|
488
|
+
exchangeName: string;
|
|
489
|
+
}, dto: {
|
|
490
|
+
note: string;
|
|
491
|
+
}) => Promise<void>;
|
|
492
|
+
commitBreakeven: (symbol: string, context: {
|
|
493
|
+
strategyName: string;
|
|
494
|
+
exchangeName: string;
|
|
495
|
+
}) => Promise<void>;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
declare class ControlMockService {
|
|
499
|
+
private readonly loggerService;
|
|
500
|
+
getStatus: (symbol: string, context: {
|
|
501
|
+
strategyName: string;
|
|
502
|
+
exchangeName: string;
|
|
503
|
+
}) => Promise<{
|
|
504
|
+
strategyInfo: any;
|
|
505
|
+
pendingSignal: any;
|
|
506
|
+
currentPrice: any;
|
|
507
|
+
}>;
|
|
508
|
+
getAveragePrice: (symbol: string, context: {
|
|
509
|
+
strategyName: string;
|
|
510
|
+
exchangeName: string;
|
|
511
|
+
}) => Promise<number>;
|
|
512
|
+
commitOpenPending: (symbol: string, context: {
|
|
513
|
+
strategyName: string;
|
|
514
|
+
exchangeName: string;
|
|
515
|
+
}, dto: {
|
|
516
|
+
position: "long" | "short";
|
|
517
|
+
cost: number;
|
|
518
|
+
note: string;
|
|
519
|
+
}) => Promise<void>;
|
|
520
|
+
commitAverageBuy: (symbol: string, context: {
|
|
521
|
+
strategyName: string;
|
|
522
|
+
exchangeName: string;
|
|
523
|
+
}, dto: {
|
|
524
|
+
cost: number;
|
|
525
|
+
note: string;
|
|
526
|
+
}) => Promise<void>;
|
|
527
|
+
commitClosePending: (symbol: string, context: {
|
|
528
|
+
strategyName: string;
|
|
529
|
+
exchangeName: string;
|
|
530
|
+
}, dto: {
|
|
531
|
+
note: string;
|
|
532
|
+
}) => Promise<void>;
|
|
533
|
+
commitBreakeven: (symbol: string, context: {
|
|
534
|
+
strategyName: string;
|
|
535
|
+
exchangeName: string;
|
|
536
|
+
}) => Promise<void>;
|
|
537
|
+
}
|
|
538
|
+
|
|
456
539
|
declare const ioc: {
|
|
457
540
|
notificationViewService: NotificationViewService;
|
|
458
541
|
storageViewService: StorageViewService;
|
|
@@ -467,6 +550,7 @@ declare const ioc: {
|
|
|
467
550
|
environmentViewService: EnvironmentViewService;
|
|
468
551
|
setupViewService: SetupViewService;
|
|
469
552
|
runtimeViewService: RuntimeViewService;
|
|
553
|
+
controlViewService: ControlViewService;
|
|
470
554
|
notificationMockService: NotificationMockService;
|
|
471
555
|
storageMockService: StorageMockService;
|
|
472
556
|
exchangeMockService: ExchangeMockService;
|
|
@@ -480,6 +564,7 @@ declare const ioc: {
|
|
|
480
564
|
environmentMockService: EnvironmentMockService;
|
|
481
565
|
setupMockService: SetupMockService;
|
|
482
566
|
runtimeMockService: RuntimeMockService;
|
|
567
|
+
controlMockService: ControlMockService;
|
|
483
568
|
liveMetaService: LiveMetaService;
|
|
484
569
|
symbolMetaService: SymbolMetaService;
|
|
485
570
|
backtestMetaService: BacktestMetaService;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as o}from"./index-fv31BaKN.js";const r=new o;export{r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,f as a,P as i,B as r,A as n,a9 as t,T as o,H as c,a3 as s,aa as l,N as d,J as p,F as m,G as u,M as b,aO as v,aP as y,aQ as g,aR as h,ad as x,aS as k,aT as f,aU as $,aV as P,aW as w,aX as C,aY as S,i as _,aG as A,a8 as O,aH as N,O as E,R as D,aZ as L,a_ as F,Z as z}from"./index-fv31BaKN.js";import{C as T,R as j}from"./Refresh-CTa-W1su.js";import{K as R}from"./KeyboardArrowLeft-YMeBM3Q3.js";const B=e=>{const i={color:"white",fontSize:28};switch(e.type){case"signal.opened":case"partial_profit.available":case"partial_profit.commit":return a(C,{sx:i});case"signal.closed":case"signal_sync.close":case"close_pending.commit":return a(x,{sx:i});case"signal.scheduled":return a(S,{sx:i});case"signal.cancelled":case"cancel_scheduled.commit":return a(k,{sx:i});case"partial_loss.available":case"partial_loss.commit":case"average_buy.commit":return a(P,{sx:i});case"breakeven.available":case"breakeven.commit":return a(w,{sx:i});case"activate_scheduled.commit":case"signal_sync.open":return a(f,{sx:i});case"trailing_stop.commit":case"trailing_take.commit":return a($,{sx:i});case"risk.rejection":return a(h,{sx:i});case"error.info":case"error.validation":case"signal.info":return a(y,{sx:i});case"error.critical":return a(g,{sx:i});default:return a(v,{sx:i})}},I=e=>{switch(e.type){case"signal.opened":return`${l("Opened")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.closed":return`${l("Closed")} ${e.symbol} (${e.pnlPercentage?`${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`:"N/A"})`;case"signal.scheduled":return`${l("Scheduled")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal.cancelled":return`${l("Cancelled")} ${e.symbol}`;case"partial_profit.available":return`${l("Partial profit")} ${e.level}% ${e.symbol}`;case"partial_profit.commit":return`${l("Profit fixed")} ${e.percentToClose}% ${e.symbol}`;case"partial_loss.available":return`${l("Partial loss")} ${e.level}% ${e.symbol}`;case"partial_loss.commit":return`${l("Loss fixed")} ${e.percentToClose}% ${e.symbol}`;case"breakeven.available":return`${l("Breakeven available")} ${e.symbol}`;case"breakeven.commit":return`${l("Breakeven set")} ${e.symbol}`;case"activate_scheduled.commit":return`${l("Activated")} ${e.position.toUpperCase()} ${e.symbol}`;case"average_buy.commit":return`${l("Average Buy")} ${e.symbol}`;case"trailing_stop.commit":return`${l("Trailing stop")} ${e.symbol}`;case"trailing_take.commit":return`${l("Trailing take")} ${e.symbol}`;case"signal_sync.open":return`${l("Sync Open")} ${e.position.toUpperCase()} ${e.symbol}`;case"signal_sync.close":return`${l("Sync Close")} ${e.symbol} (${e.pnlPercentage?`${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`:"N/A"})`;case"cancel_scheduled.commit":return`${l("Cancel Scheduled")} ${e.symbol}`;case"close_pending.commit":return`${l("Close Pending")} ${e.symbol}`;case"risk.rejection":return`${l("Rejected")} ${e.position.toUpperCase()} ${e.symbol}`;case"error.info":return`${l("Error")}: ${e.message}`;case"error.validation":return`${l("Validation")}: ${e.message}`;case"error.critical":return`${l("Critical")}: ${e.message}`;case"signal.info":return`${l("Signal Info")} ${e.symbol} (${e.pnlPercentage?`${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`:"N/A"})`;default:return l("Unknown")}},U=e=>{switch(e.type){case"signal.opened":return l("Signal Opened");case"signal.closed":return l("Signal Closed");case"signal.scheduled":return l("Signal Scheduled");case"signal.cancelled":return l("Signal Cancelled");case"partial_profit.available":return l("Partial Profit Available");case"partial_profit.commit":return l("Partial Profit Commit");case"partial_loss.available":return l("Partial Loss Available");case"partial_loss.commit":return l("Partial Loss Commit");case"breakeven.available":return l("Breakeven Available");case"breakeven.commit":return l("Breakeven Commit");case"activate_scheduled.commit":return l("Activated Scheduled");case"average_buy.commit":return l("Average Buy");case"trailing_stop.commit":return l("Trailing Stop");case"trailing_take.commit":return l("Trailing Take");case"signal_sync.open":return l("Signal Sync Open");case"signal_sync.close":return l("Signal Sync Close");case"cancel_scheduled.commit":return l("Cancel Scheduled");case"close_pending.commit":return l("Close Pending");case"risk.rejection":return l("Risk Rejection");case"error.info":return l("Info Error");case"error.validation":return l("Validation Error");case"error.critical":return l("Critical Error");case"signal.info":return l("Signal Info");default:return l("Unknown")}},W=e=>"symbol"in e,M=e=>"position"in e,H=e=>"priceOpen"in e&&"priceTakeProfit"in e&&"priceStopLoss"in e,Y=e=>"pnlPercentage"in e,V=e=>"level"in e,G=e=>"percentToClose"in e,K=e=>"currentPrice"in e,Z=e=>"duration"in e,q=e=>"closeReason"in e,J=e=>"cancelReason"in e,Q=e=>"percentShift"in e,X=e=>"signal.opened"===e.type?"note"in e&&!!e.note:"signal.info"===e.type?"note"in e&&!!e.note&&!!e.notificationId:"activate_scheduled.commit"===e.type?"note"in e&&!!e.note&&!!e.activateId:"close_pending.commit"===e.type?"note"in e&&!!e.note&&!!e.closeId:"cancel_scheduled.commit"===e.type&&("note"in e&&!!e.note&&!!e.cancelId),ee=e=>"message"in e,ae=e=>"rejectionNote"in e,ie=e=>"activePositionCount"in e,re=e=>"effectivePriceOpen"in e,ne=e=>"totalEntries"in e&&e.totalEntries>1,te=e=>"originalPriceOpen"in e&&"priceOpen"in e&&e.originalPriceOpen!==e.priceOpen,oe=e=>"totalPartials"in e&&e.totalPartials>0,ce=e=>"cost"in e,se=e=>"pnlPriceOpen"in e&&"pnlPriceClose"in e&&"pnlCost"in e&&"pnlEntries"in e,le=e=>"peakProfitPriceClose"in e,de=e=>"maxDrawdownPriceClose"in e,pe=e.forwardRef(({item:e,className:v,style:y,sx:g},h)=>{const x=(e=>{switch(e.type){case"signal.opened":case"activate_scheduled.commit":case"signal_sync.open":return"#4CAF50";case"signal.closed":case"signal_sync.close":return"#2196F3";case"signal.scheduled":case"average_buy.commit":case"error.info":case"error.validation":return"#FF9800";case"signal.cancelled":case"cancel_scheduled.commit":default:return"#9E9E9E";case"partial_profit.available":case"partial_profit.commit":return"#8BC34A";case"partial_loss.available":case"partial_loss.commit":return"#FF5722";case"breakeven.available":case"breakeven.commit":return"#00BCD4";case"trailing_stop.commit":case"trailing_take.commit":return"#673AB7";case"close_pending.commit":return"#607D8B";case"risk.rejection":return"#F44336";case"error.critical":return"#D32F2F";case"signal.info":return"#9C27B0"}})(e),k=(e=>"timestamp"in e)(e)?e.timestamp:Date.now();return a("div",{className:v,style:y,ref:h,children:a(i,{variant:"outlined",onClick:()=>(e=>{switch(e.type){case"risk.rejection":_.layoutService.pickRisk(e.id);break;case"signal.opened":_.layoutService.pickSignalOpened(e.id);break;case"signal.closed":_.layoutService.pickSignalClosed(e.id);break;case"signal.scheduled":_.layoutService.pickSignalScheduled(e.id);break;case"signal.cancelled":_.layoutService.pickSignalCancelled(e.id);break;case"partial_profit.available":_.layoutService.pickPartialProfitAvailable(e.id);break;case"partial_profit.commit":_.layoutService.pickPartialProfitCommit(e.id);break;case"partial_loss.available":_.layoutService.pickPartialLossAvailable(e.id);break;case"partial_loss.commit":_.layoutService.pickPartialLossCommit(e.id);break;case"breakeven.available":_.layoutService.pickBreakevenAvailable(e.id);break;case"breakeven.commit":_.layoutService.pickBreakevenCommit(e.id);break;case"trailing_stop.commit":_.layoutService.pickTrailingStop(e.id);break;case"trailing_take.commit":_.layoutService.pickTrailingTake(e.id);break;case"activate_scheduled.commit":_.layoutService.pickActivateScheduled(e.id);break;case"average_buy.commit":_.layoutService.pickAverageBuyCommit(e.id);break;case"signal_sync.open":_.layoutService.pickSignalSyncOpen(e.id);break;case"signal_sync.close":_.layoutService.pickSignalSyncClose(e.id);break;case"cancel_scheduled.commit":_.layoutService.pickCancelScheduled(e.id);break;case"close_pending.commit":_.layoutService.pickClosePending(e.id);break;case"signal.info":_.layoutService.pickSignalNotify(e.id)}})(e),sx:{transition:"box-shadow 0.2s ease",cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{boxShadow:4},...g},children:a(r,{sx:{flex:1,position:"relative",overflow:"clip",height:"100%",width:"100%",borderRadius:"12px"},children:[a(n,{direction:"row",spacing:2,sx:{p:2},children:[a(t,{sx:{width:56,height:56,background:x},children:B(e)}),a(n,{flex:1,spacing:1,children:[a(n,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[a(o,{variant:"h6",sx:{fontWeight:600},children:I(e)}),a(o,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap",ml:2},children:c(k).format("HH:mm DD/MM/YYYY")})]}),a(n,{mt:-1,direction:"row",flexWrap:"wrap",children:[a(s,{size:"small",label:U(e),sx:{background:x,mt:1,mr:1,color:"white",fontWeight:500}}),W(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:e.symbol,variant:"outlined"}),M(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:e.position.toUpperCase(),variant:"outlined",color:"long"===e.position?"success":"error"}),Y(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:"PnL: "+(e.pnlPercentage?`${e.pnlPercentage>0?"+":""}${e.pnlPercentage.toFixed(2)}%`:"N/A"),color:e.pnlPercentage>=0?"success":"error",variant:"outlined"}),V(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Level")}: ${e.level}%`,variant:"outlined"}),G(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Close")}: ${e.percentToClose}%`,variant:"outlined"}),Z(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Duration")}: ${e.duration} ${l("min")}`,variant:"outlined"}),q(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:e.closeReason,variant:"outlined",color:"info"}),J(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:e.cancelReason,variant:"outlined",color:"info"}),Q(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Shift")}: ${e.percentShift>0?"+":""}${e.percentShift}%`,variant:"outlined"}),ie(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Active")}: ${e.activePositionCount}`,variant:"outlined"}),ne(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Entries")}: ${e.totalEntries}`,variant:"outlined"}),oe(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Partials")}: ${e.totalPartials}`,variant:"outlined"}),ce(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Cost")}: ${e.cost?`${e.cost.toFixed(d(e.cost))}$`:"N/A"}`,variant:"outlined"}),re(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Avg entry")}: ${e.effectivePriceOpen?p(e.effectivePriceOpen,d(e.effectivePriceOpen)):"N/A"}`,variant:"outlined",color:"warning"}),te(e)&&a(s,{size:"small",sx:{mt:1,mr:1},label:`${l("Orig entry")}: ${e.originalPriceOpen?p(e.originalPriceOpen,d(e.originalPriceOpen)):"N/A"}`,variant:"outlined"})]}),H(e)&&a(m,{children:[a(u,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[K(e)&&a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Current"),":"," "]}),e.currentPrice?p(e.currentPrice,d(e.currentPrice)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Take Profit"),":"," "]}),e.priceTakeProfit?p(e.priceTakeProfit,d(e.priceTakeProfit)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Stop Loss"),":"," "]}),e.priceStopLoss?p(e.priceStopLoss,d(e.priceStopLoss)):"N/A"]})]})]}),se(e)&&a(m,{children:[a(u,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL Entry"),":"," "]}),e.pnlPriceOpen?p(e.pnlPriceOpen,d(e.pnlPriceOpen)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL Exit"),":"," "]}),e.pnlPriceClose?p(e.pnlPriceClose,d(e.pnlPriceClose)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("PnL"),":"," "]}),a(o,{component:"span",color:e.pnlCost>=0?"success.main":"error.main",children:e.pnlCost?`${e.pnlCost>=0?"+":""}${e.pnlCost.toFixed(d(e.pnlCost))}$`:"N/A"})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.pnlEntries?`${e.pnlEntries.toFixed(d(e.pnlEntries))}$`:"N/A"]})]})]}),le(e)&&a(m,{children:[a(u,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak Entry"),":"," "]}),e.peakProfitPriceOpen?p(e.peakProfitPriceOpen,d(e.peakProfitPriceOpen)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak Exit"),":"," "]}),e.peakProfitPriceClose?p(e.peakProfitPriceClose,d(e.peakProfitPriceClose)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Peak"),":"," "]}),a(o,{component:"span",color:e.peakProfitCost>=0?"success.main":"error.main",children:e.peakProfitCost?`${e.peakProfitCost>=0?"+":""}${e.peakProfitCost.toFixed(d(e.peakProfitCost))}$`:"N/A"})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.peakProfitEntries?`${e.peakProfitEntries.toFixed(d(e.peakProfitEntries))}$`:"N/A"]})]})]}),de(e)&&a(m,{children:[a(u,{sx:{my:1}}),a(n,{direction:"row",spacing:3,flexWrap:"wrap",children:[a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown Entry"),":"," "]}),e.maxDrawdownPriceOpen?p(e.maxDrawdownPriceOpen,d(e.maxDrawdownPriceOpen)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown Exit"),":"," "]}),e.maxDrawdownPriceClose?p(e.maxDrawdownPriceClose,d(e.maxDrawdownPriceClose)):"N/A"]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Drawdown"),":"," "]}),a(o,{component:"span",color:e.maxDrawdownCost>=0?"success.main":"error.main",children:e.maxDrawdownCost?`${e.maxDrawdownCost>=0?"+":""}${e.maxDrawdownCost.toFixed(d(e.maxDrawdownCost))}$`:"N/A"})]}),a(o,{variant:"body2",children:[a(o,{component:"span",color:"text.secondary",children:[l("Invested"),":"," "]}),e.maxDrawdownEntries?`${e.maxDrawdownEntries.toFixed(d(e.maxDrawdownEntries))}$`:"N/A"]})]})]})]})]}),X(e)&&a(r,{onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{px:2,pb:2},children:[a(u,{sx:{mb:1.5}}),a(r,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordWrap:"break-word"},children:a(b,{content:e.note})})]}),ae(e)&&a(r,{sx:{px:2,pb:2},children:[a(u,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"error",children:e.rejectionNote})]}),ee(e)&&!X(e)&&a(r,{sx:{px:2,pb:2},children:[a(u,{sx:{mb:1.5}}),a(o,{variant:"body2",color:"text.secondary",children:e.message})]}),a(r,{sx:{position:"absolute",top:0,left:0,bottom:0,width:6,zIndex:1,background:x}})]})})})}),me=[{action:"update-now",label:"Refresh manually",icon:()=>a(z,{icon:j,color:"#4caf50"})}],ue=[{type:D.Link,action:"back-action",label:a(R,{sx:{display:"block"}})},{type:D.Link,action:"back-action",label:"Main"},{type:D.Link,action:"back-action",label:"Notifications"}],be=new O,ve=()=>{const{data:e,hasMore:i,loading:r,onSkip:n}=A({handler:async(e,a)=>{const i=await _.notificationViewService.getList(),r=N(e,a);for(const n of i)if(r([n]).done)break;return r().rows},onLoadStart:()=>_.layoutService.setAppbarLoader(!0),onLoadEnd:()=>_.layoutService.setAppbarLoader(!1),reloadSubject:be});return a(T,{children:[a(E,{items:ue,actions:me,onAction:async e=>{"back-action"===e&&_.routerService.push("/"),"update-now"===e&&await be.next()}}),a(L,{sx:{height:"calc(100vh - 155px)"},withScrollbar:!0,minHeight:72,loading:r,onDataRequest:n,bufferSize:F,hasMore:i,children:e.map(e=>a(pe,{item:e,sx:{mb:1}},e.id))})]})};export{ve as NotificationPage,ve as default};
|