매매시그널 실행조건 화면 공용 적용
This commit is contained in:
@@ -1709,6 +1709,7 @@ export async function fetchLiveConditionScanSignals(
|
||||
chartTimeframe: string,
|
||||
indicatorParams?: Record<string, Record<string, unknown>> | null,
|
||||
evaluationBarCount?: number | null,
|
||||
positionMode?: 'LONG_ONLY' | 'SIGNAL_ONLY' | null,
|
||||
): Promise<BacktestSignal[]> {
|
||||
if (chartBars.length === 0 || !chartTimeframe) return [];
|
||||
const list = await requestOrThrow<BacktestSignal[]>('/strategy/live-conditions/scan-signals', {
|
||||
@@ -1728,6 +1729,7 @@ export async function fetchLiveConditionScanSignals(
|
||||
})),
|
||||
timeframe: chartTimeframe,
|
||||
evaluationBarCount: evaluationBarCount ?? undefined,
|
||||
positionMode: positionMode ?? undefined,
|
||||
}),
|
||||
});
|
||||
return list ?? [];
|
||||
|
||||
@@ -53,6 +53,8 @@ export async function fetchStrategyEvaluationSignals(opts: {
|
||||
const initialCapital = btSettings.initialCapital ?? 10_000_000;
|
||||
const commissionRate = resolveEvaluationCommissionRate(btSettings);
|
||||
|
||||
const positionMode = btSettings.positionMode ?? 'LONG_ONLY';
|
||||
|
||||
if (isScanSignalsExecutionMode(btSettings)) {
|
||||
const signals = await fetchLiveConditionScanSignals(
|
||||
opts.market,
|
||||
@@ -61,11 +63,12 @@ export async function fetchStrategyEvaluationSignals(opts: {
|
||||
opts.timeframe,
|
||||
indicatorParams,
|
||||
opts.evaluationBarCount,
|
||||
positionMode,
|
||||
);
|
||||
return {
|
||||
signals,
|
||||
initialCapital,
|
||||
settings: { ...btSettings, positionMode: 'SIGNAL_ONLY', tradeExecutionMode },
|
||||
settings: { ...btSettings, positionMode, tradeExecutionMode },
|
||||
commissionRate,
|
||||
tradeExecutionMode,
|
||||
};
|
||||
@@ -73,7 +76,7 @@ export async function fetchStrategyEvaluationSignals(opts: {
|
||||
|
||||
const settings: BacktestSettingsDto = {
|
||||
...btSettings,
|
||||
positionMode: 'SIGNAL_ONLY',
|
||||
positionMode,
|
||||
tradeExecutionMode: 'BACKTEST_ENGINE',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user