일목균형표 수정
This commit is contained in:
@@ -5,6 +5,7 @@ import { normalizeStartCandleType } from './strategyStartNodes';
|
||||
import type { StrategyDto } from './backendApi';
|
||||
import type { LogicNode } from './strategyTypes';
|
||||
import type { VirtualSessionConfig, VirtualTargetItem } from './virtualTradingStorage';
|
||||
import { resolveVirtualTargetStrategyId } from './virtualTargetStrategy';
|
||||
|
||||
function collectUiTimeframes(strategy: StrategyDto | null | undefined): string[] {
|
||||
if (!strategy) return [];
|
||||
@@ -15,7 +16,8 @@ function collectUiTimeframes(strategy: StrategyDto | null | undefined): string[]
|
||||
...collectDslBranches(buy ?? null),
|
||||
...collectDslBranches(sell ?? null),
|
||||
]) {
|
||||
set.add(normalizeStartCandleType(b.candleType));
|
||||
const types = b.candleTypes?.length ? b.candleTypes : [b.candleType];
|
||||
for (const ct of types) set.add(normalizeStartCandleType(ct));
|
||||
}
|
||||
return [...set];
|
||||
}
|
||||
@@ -76,7 +78,7 @@ export async function syncVirtualTargetsToBackend(
|
||||
}
|
||||
|
||||
const pinJobs = targets.map(async t => {
|
||||
const strategyId = t.strategyId ?? session.globalStrategyId;
|
||||
const strategyId = resolveVirtualTargetStrategyId(t, session.globalStrategyId);
|
||||
if (strategyId == null) return;
|
||||
await pinStrategyEvaluationTimeframes(t.market, strategyId);
|
||||
});
|
||||
@@ -86,7 +88,7 @@ export async function syncVirtualTargetsToBackend(
|
||||
targets.map(t =>
|
||||
saveLiveStrategySettings({
|
||||
market: t.market,
|
||||
strategyId: t.strategyId ?? session.globalStrategyId,
|
||||
strategyId: resolveVirtualTargetStrategyId(t, session.globalStrategyId),
|
||||
isPinned: !!t.pinned,
|
||||
skipGlobalTemplate: true,
|
||||
...shared,
|
||||
|
||||
Reference in New Issue
Block a user