매매 시그널 알림 화면 수정
This commit is contained in:
@@ -276,7 +276,8 @@ function wrapTimeframes(candleTypes: string[], root: LogicNode): LogicNode {
|
||||
|
||||
/** 편집기 상태 → 저장/평가용 DSL (TIMEFRAME 래핑) */
|
||||
export function encodeConditionForSave(state: EditorConditionState): LogicNode | null {
|
||||
const branches = collectEditorBranches(state).filter(
|
||||
const synced = syncEditorStateCandleTypesForSave(state);
|
||||
const branches = collectEditorBranches(synced).filter(
|
||||
(b): b is ConditionBranch & { root: LogicNode } => b.root != null,
|
||||
);
|
||||
|
||||
@@ -414,6 +415,15 @@ export function syncBuySellPrimaryStartCandleTypes(
|
||||
};
|
||||
}
|
||||
|
||||
/** 저장 직전 — 각 START 분봉을 조건 트리 left/rightCandleType 에 반영 */
|
||||
export function syncEditorStateCandleTypesForSave(state: EditorConditionState): EditorConditionState {
|
||||
let next = state;
|
||||
for (const section of collectStartSections(state)) {
|
||||
next = updateStartCandleTypes(next, section.startId, section.candleTypes);
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
/** 저장 직전 — 양쪽 START 분봉 합집합을 각 탭에 반영 (매수만 설정한 경우 매도 DSL도 동기화) */
|
||||
export function alignBuySellStartCandleTypesForSave(
|
||||
buy: EditorConditionState,
|
||||
@@ -423,7 +433,11 @@ export function alignBuySellStartCandleTypesForSave(
|
||||
...getStartCandleTypes(buy.startMeta[START_NODE_ID]),
|
||||
...getStartCandleTypes(sell.startMeta[START_NODE_ID]),
|
||||
]);
|
||||
return syncBuySellPrimaryStartCandleTypes(buy, sell, merged);
|
||||
const synced = syncBuySellPrimaryStartCandleTypes(buy, sell, merged);
|
||||
return {
|
||||
buy: syncEditorStateCandleTypesForSave(synced.buy),
|
||||
sell: syncEditorStateCandleTypesForSave(synced.sell),
|
||||
};
|
||||
}
|
||||
|
||||
/** 저장된 DSL에서 Logic Expression용 분기 목록 */
|
||||
|
||||
Reference in New Issue
Block a user