복합지표 전략 추가

This commit is contained in:
Macbook
2026-06-12 13:26:53 +09:00
parent 9208418c33
commit 52137cf1db
27 changed files with 2712 additions and 55 deletions
+32 -22
View File
@@ -1,6 +1,14 @@
import type { LogicNode } from './strategyTypes';
import { genId, type DefType } from './strategyEditorShared';
import { nhPriorField, nlPriorField } from './priceExtremeIndicators';
import {
buildInflection33BuyTree,
buildInflection33SellTree,
} from './inflection33Strategy';
import {
buildNewHigh920BuyTree,
buildNewLow920SellTree,
} from './priceExtremeBreakoutPair';
export type SimpleStrategyTemplate = {
kind: 'simple';
@@ -86,26 +94,14 @@ function ichimokuTenkanKijunCross(signal: 'buy' | 'sell'): LogicNode {
);
}
/** 33변곡 매수 — 바닥권 시간변곡(약 33거래일 주기) 전환 구간 */
export function build33InflectionBuyTree(): LogicNode {
return andTree(
condition('RSI', 'CROSS_UP', 'RSI_VALUE', 'OVERSOLD_30'),
condition('MA', 'CROSS_UP', 'MA5', 'MA20'),
condition('MA', 'CROSS_UP', 'CLOSE_PRICE', 'MA20'),
condition('MACD', 'CROSS_UP', 'MACD_LINE', 'SIGNAL_LINE'),
condition('DISPARITY', 'CROSS_UP', 'DISPARITY20', 'OVERSOLD_95'),
);
/** @deprecated inflection33Strategy.buildInflection33BuyTree 사용 */
export function build33InflectionBuyTree(def?: DefType): LogicNode {
return buildInflection33BuyTree(def ?? { maLines: [5, 10, 20, 60, 120] } as DefType);
}
/** 33변곡 매도 — 상승 5파 끝(33·36·38일 변곡) 구간 이탈 */
export function build33InflectionSellTree(): LogicNode {
return andTree(
condition('RSI', 'GTE', 'RSI_VALUE', 'OVERBOUGHT_70'),
condition('MA', 'CROSS_DOWN', 'MA5', 'MA20'),
condition('MA', 'CROSS_DOWN', 'CLOSE_PRICE', 'MA20'),
condition('MACD', 'CROSS_DOWN', 'MACD_LINE', 'SIGNAL_LINE'),
condition('DISPARITY', 'GTE', 'DISPARITY20', 'OVERBOUGHT_105'),
);
/** @deprecated inflection33Strategy.buildInflection33SellTree 사용 */
export function build33InflectionSellTree(def?: DefType): LogicNode {
return buildInflection33SellTree(def ?? { maLines: [5, 10, 20, 60, 120] } as DefType);
}
export function getStrategyTemplates(def: DefType): StrategyTemplateDef[] {
@@ -169,19 +165,33 @@ export function getStrategyTemplates(def: DefType): StrategyTemplateDef[] {
label: '20일 신저가 이탈',
description: '종가가 직전 20봉 최저가 이하 — 추세 이탈 청산',
},
{
kind: 'composite',
signal: 'buy',
label: '9·20일 신고가 매수',
description: '9·20일 신고가 돌파 + ADX·거래량 필터 (기본: 보통)',
build: () => buildNewHigh920BuyTree(def),
},
{
kind: 'composite',
signal: 'sell',
label: '9·20일 신저가 매도',
description: '9·20일 신저가 이탈 + ADX·거래량 필터 (기본: 보통)',
build: () => buildNewLow920SellTree(def),
},
{
kind: 'composite',
signal: 'buy',
label: '33변곡 매수',
description: '바닥권 시간변곡 — RSI 과매도 탈출 + MA 골든크로스 + 20일선·이격도 돌파',
build: build33InflectionBuyTree,
description: '33 EMA 상승 변곡 + 종가 EMA 위 + 33봉 종가 채널 상향 돌파',
build: () => build33InflectionBuyTree(def),
},
{
kind: 'composite',
signal: 'sell',
label: '33변곡 매도',
description: '상승 5파 끝 변곡 — RSI 과매수 + MA 데드크로스 + 20일선·이격도 이탈',
build: build33InflectionSellTree,
description: '33 EMA 하락 변곡 이탈 OR 33봉 종가 채널 하향 이탈',
build: () => build33InflectionSellTree(def),
},
{
kind: 'composite',