전략 시간봉 오류 수정
This commit is contained in:
@@ -399,6 +399,31 @@ export function collectTimeframesFromEditorState(state: EditorConditionState): s
|
||||
return [...set];
|
||||
}
|
||||
|
||||
/** 매수·매도 START(기본) 평가 분봉을 동일하게 맞춤 — 한쪽만 3m·5m 체크 시 다른 쪽 1m 잔존 방지 */
|
||||
export function syncBuySellPrimaryStartCandleTypes(
|
||||
buy: EditorConditionState,
|
||||
sell: EditorConditionState,
|
||||
candleTypes: string[],
|
||||
): { buy: EditorConditionState; sell: EditorConditionState } {
|
||||
const types = normalizeCandleTypesList(candleTypes);
|
||||
return {
|
||||
buy: updateStartCandleTypes(buy, START_NODE_ID, types),
|
||||
sell: updateStartCandleTypes(sell, START_NODE_ID, types),
|
||||
};
|
||||
}
|
||||
|
||||
/** 저장 직전 — 양쪽 START 분봉 합집합을 각 탭에 반영 (매수만 설정한 경우 매도 DSL도 동기화) */
|
||||
export function alignBuySellStartCandleTypesForSave(
|
||||
buy: EditorConditionState,
|
||||
sell: EditorConditionState,
|
||||
): { buy: EditorConditionState; sell: EditorConditionState } {
|
||||
const merged = normalizeCandleTypesList([
|
||||
...getStartCandleTypes(buy.startMeta[START_NODE_ID]),
|
||||
...getStartCandleTypes(sell.startMeta[START_NODE_ID]),
|
||||
]);
|
||||
return syncBuySellPrimaryStartCandleTypes(buy, sell, merged);
|
||||
}
|
||||
|
||||
/** 저장된 DSL에서 Logic Expression용 분기 목록 */
|
||||
export function collectDslBranches(dsl: LogicNode | null): ConditionBranch[] {
|
||||
return collectEditorBranches(decodeConditionForEditor(dsl));
|
||||
|
||||
Reference in New Issue
Block a user