직접입력값 평가오류 수정
This commit is contained in:
@@ -74,6 +74,7 @@ import {
|
||||
import ComboFieldSelect from '../components/strategyEditor/ComboFieldSelect';
|
||||
import {
|
||||
activateDirectThresholdInput,
|
||||
canonicalizeConditionThreshold,
|
||||
getCompositeFieldOpts,
|
||||
getCompositePeriodPresetOptions,
|
||||
getConditionRightPeriod,
|
||||
@@ -923,7 +924,7 @@ export function resolveFieldOptionValue(indicatorType: string, field?: string):
|
||||
export const nodeToText = (node: LogicNode, DEF: DefType = DEF_DEFAULTS): string => {
|
||||
if (!node) return '';
|
||||
if (node.type === 'CONDITION' && node.condition) {
|
||||
const c = normalizeCompositeCondition(node.condition);
|
||||
const c = canonicalizeConditionThreshold(normalizeCompositeCondition(node.condition));
|
||||
const indName = getStrategyIndicatorDisplayName(c.indicatorType);
|
||||
const opts = getFieldOpts(c.indicatorType, 'buy', DEF, c);
|
||||
const C = condLabel(c.conditionType);
|
||||
@@ -1154,7 +1155,7 @@ export const CondEditor: React.FC<CondEditorProps> = ({
|
||||
const handleRight = (v: string) => {
|
||||
if (isThresholdSymbol(v)) {
|
||||
const { targetValue: _t, ...rest } = normalized;
|
||||
onChange({ ...rest, rightField: v, thresholdOverride: false });
|
||||
onChange(canonicalizeConditionThreshold({ ...rest, rightField: v, thresholdOverride: false }));
|
||||
return;
|
||||
}
|
||||
const thresholds: Record<string,number> = {
|
||||
@@ -1176,7 +1177,7 @@ export const CondEditor: React.FC<CondEditorProps> = ({
|
||||
if (priorP != null && isPriceExtremeIndicator(normalized.indicatorType)) {
|
||||
upd = syncPriceExtremeSimpleFields({ ...upd, period: priorP });
|
||||
}
|
||||
onChange(upd);
|
||||
onChange(canonicalizeConditionThreshold(upd));
|
||||
};
|
||||
|
||||
if (normalized.composite) {
|
||||
@@ -1441,7 +1442,11 @@ export const CondEditor: React.FC<CondEditorProps> = ({
|
||||
def,
|
||||
));
|
||||
}}
|
||||
onCustomNumberChange={v => onChange(setConditionThreshold(normalized, 'right', v, def, { directInput: true }))}
|
||||
onCustomNumberChange={v => onChange(
|
||||
canonicalizeConditionThreshold(
|
||||
setConditionThreshold(normalized, 'right', v, def, { directInput: true }),
|
||||
),
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
{/* 조건 */}
|
||||
|
||||
Reference in New Issue
Block a user