Spaces:
Running
Running
Jimin Huang
commited on
Commit
·
66dc6d7
1
Parent(s):
3d84ff1
Change settings
Browse files
src/components/CompareChartE.vue
CHANGED
|
@@ -7,7 +7,7 @@ import { onMounted, onBeforeUnmount, ref, watch } from 'vue'
|
|
| 7 |
import * as echarts from 'echarts'
|
| 8 |
|
| 9 |
// ⬇️ adjust these imports to match your project structure if needed
|
| 10 |
-
import { dataService
|
| 11 |
import {
|
| 12 |
computeStrategyEquity,
|
| 13 |
computeBuyHoldEquity,
|
|
@@ -15,6 +15,16 @@ import {
|
|
| 15 |
getStrategyColor,
|
| 16 |
} from '../lib/strategies'
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
// ---------- props ----------
|
| 19 |
const props = defineProps({
|
| 20 |
selected: { type: Array, default: () => [] }, // [{agent_name, asset, model, strategy, decision_ids?}, ...]
|
|
|
|
| 7 |
import * as echarts from 'echarts'
|
| 8 |
|
| 9 |
// ⬇️ adjust these imports to match your project structure if needed
|
| 10 |
+
import { dataService } from '../lib/dataService'
|
| 11 |
import {
|
| 12 |
computeStrategyEquity,
|
| 13 |
computeBuyHoldEquity,
|
|
|
|
| 15 |
getStrategyColor,
|
| 16 |
} from '../lib/strategies'
|
| 17 |
|
| 18 |
+
|
| 19 |
+
function isNyseTradingDay(dateStr) {
|
| 20 |
+
const d = new Date(`${dateStr}T00:00:00Z`)
|
| 21 |
+
const day = d.getUTCDay() // 0=Sun, 6=Sat
|
| 22 |
+
return day !== 0 && day !== 6
|
| 23 |
+
}
|
| 24 |
+
async function filterRowsToNyseTradingDays(seq) {
|
| 25 |
+
return Array.isArray(seq) ? seq.filter(r => isNyseTradingDay(r.date)) : []
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
// ---------- props ----------
|
| 29 |
const props = defineProps({
|
| 30 |
selected: { type: Array, default: () => [] }, // [{agent_name, asset, model, strategy, decision_ids?}, ...]
|