전략편집기 저장오휴 수정
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** 전략 조건 DSL — 보조지표 DB 설정과 임계값·기간 상inherit 정규화 */
|
||||
import type { ConditionDSL, LogicNode } from './strategyTypes';
|
||||
import type { DefType } from './strategyEditorShared';
|
||||
import { getDefaultConditionFields } from './strategyEditorShared';
|
||||
import { getDefaultConditionFields, getRightFieldOpts } from './strategyEditorShared';
|
||||
import {
|
||||
ensureDirectThresholdSnapshot,
|
||||
isThresholdOverridden,
|
||||
@@ -10,9 +10,7 @@ import {
|
||||
VALUE_FIELD_PREFIX,
|
||||
} from './conditionPeriods';
|
||||
import {
|
||||
defaultInheritedThresholdField,
|
||||
inferThresholdSymbolFromLegacyExact,
|
||||
isThresholdFieldOrSymbol,
|
||||
isThresholdSymbol,
|
||||
} from './thresholdSymbols';
|
||||
import { parseThresholdField, setDirectThreshold } from './conditionPeriods';
|
||||
@@ -45,10 +43,13 @@ function migrateConditionThreshold(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!rightField || (!isThresholdSymbol(rightField) && !rightField.startsWith('K_'))) {
|
||||
const defaults = getDefaultConditionFields(cond.indicatorType, signalType, def);
|
||||
if (isThresholdFieldOrSymbol(defaults.r)) {
|
||||
rightField = defaults.r;
|
||||
if (!rightField) {
|
||||
rightField = getDefaultConditionFields(cond.indicatorType, signalType, def).r;
|
||||
} else if (!isThresholdSymbol(rightField) && !rightField.startsWith('K_')) {
|
||||
const rightOpts = getRightFieldOpts(cond.indicatorType, signalType, def, cond);
|
||||
const isValidRight = rightOpts.some(o => o.value === rightField);
|
||||
if (!isValidRight) {
|
||||
rightField = getDefaultConditionFields(cond.indicatorType, signalType, def).r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user