일목균형표 전략조건 수정

This commit is contained in:
Macbook
2026-06-16 20:47:53 +09:00
parent 1bc275fc53
commit 2155c46d2a
7 changed files with 38 additions and 16 deletions
+13 -10
View File
@@ -143,12 +143,12 @@ export const STABLE_STRATEGY_PALETTE_ITEMS: StableStrategyPaletteMeta[] = [
},
{
value: ICHIMOKU_SANYAKU_BUY, label: '일목 삼역호전 매수', strategyId: 'ICHIMOKU_SANYAKU', mode: 'buy',
desc: '4단계 Full-AND — 전환·기준·구름·후행·MA60·거래량 (일목 산인 삼역好轉)',
desc: '4단계 Full-AND — 후행 구름 돌파 1회 트리거 + 삼역호전 필터',
periodHint: '9 / 26 / 52',
},
{
value: ICHIMOKU_SANYAKU_SELL, label: '일목 삼역호전 매도', strategyId: 'ICHIMOKU_SANYAKU', mode: 'sell',
desc: '분할 청산 OR — 전환선 이탈 / 기준선·데드크로스 / 구름 하방',
desc: '전환·기준·구름 하향 돌파 이벤트 OR (유지조건 제외)',
periodHint: '9 / 26 / 52',
},
{
@@ -371,22 +371,23 @@ function buildIchimokuTrendSell(def: IndicatorPeriodDef, level: StableStrategyFi
return wrapOrRoot(branches, pairMeta('ICHIMOKU_TREND', 'sell', level));
}
/** 일목 삼역호전(三役好轉) — 4단계 Full-AND 매수 */
/** 일목 삼역호전(三役好轉) — 4단계 Full-AND 매수 (1회성 트리거) */
function buildIchimokuSanyakuBuy(def: IndicatorPeriodDef, level: StableStrategyFilterLevel): LogicNode {
const nodes: LogicNode[] = [
// [1단계] 주가·단기 추세
// [트리거] 후행스팬 26봉전 구름 상향 돌파 — 삼역호전 최종 잠금 순간 1회
makeCondition('ICHIMOKU', 'CHIKOU_CROSS_ABOVE_PRIOR_CLOUD', 'NONE', 'NONE', def),
// [1단계] 주가·단기 추세 (진입 봉 동시 충족)
makeCondition('ICHIMOKU', 'GT', 'CLOSE_PRICE', 'CONVERSION_LINE', def),
makeCondition('ICHIMOKU', 'GT', 'CLOSE_PRICE', 'BASE_LINE', def),
makeCondition('ICHIMOKU', 'GT', 'CONVERSION_LINE', 'BASE_LINE', def),
// [2단계] 구름대·양운
makeCondition('ICHIMOKU', 'ABOVE_CLOUD', 'CLOSE_PRICE', 'NONE', def),
makeCondition('ICHIMOKU', 'SPAN1_GT_SPAN2', 'LEADING_SPAN1', 'LEADING_SPAN2', def),
// [3단계] 후행스팬 2중 잠금
// [3단계] 후행스팬 호전 유지
makeCondition('ICHIMOKU', 'LAGGING_GT_PRICE', 'LAGGING_SPAN', 'CLOSE_PRICE', def),
makeCondition('ICHIMOKU', 'LAGGING_ABOVE_PRIOR_CLOUD', 'NONE', 'NONE', def),
];
if (level !== 'relaxed') {
// [4단계] MA60 대세 + 거래량
nodes.push(makeCondition('MA', 'GT', 'CLOSE_PRICE', maField(60), def));
if (level === 'strict') {
nodes.push(makeVolumeMaRatioFilter(def, 1.5, 5));
@@ -397,16 +398,16 @@ function buildIchimokuSanyakuBuy(def: IndicatorPeriodDef, level: StableStrategyF
return wrapAnd(nodes, pairMeta('ICHIMOKU_SANYAKU', 'buy', level));
}
/** 일목 삼역호전 — 분할 매도 OR (전환선 → 기준선/데드 → 구름) */
/** 일목 삼역호전 — 분할 청산 OR (돌파 이벤트만, 유지조건 제외) */
function buildIchimokuSanyakuSell(def: IndicatorPeriodDef, level: StableStrategyFilterLevel): LogicNode {
void level;
return wrapOrRoot([
makeCondition('ICHIMOKU', 'LT', 'CLOSE_PRICE', 'CONVERSION_LINE', def),
makeCondition('ICHIMOKU', 'CROSS_DOWN', 'CLOSE_PRICE', 'CONVERSION_LINE', def),
wrapOr([
makeCondition('ICHIMOKU', 'LT', 'CLOSE_PRICE', 'BASE_LINE', def),
makeCondition('ICHIMOKU', 'CROSS_DOWN', 'CLOSE_PRICE', 'BASE_LINE', def),
makeCondition('ICHIMOKU', 'CROSS_DOWN', 'CONVERSION_LINE', 'BASE_LINE', def),
]),
makeCondition('ICHIMOKU', 'BELOW_CLOUD', 'CLOSE_PRICE', 'NONE', def),
makeCondition('ICHIMOKU', 'CLOUD_BREAK_DOWN', 'CLOSE_PRICE', 'NONE', def),
], pairMeta('ICHIMOKU_SANYAKU', 'sell', level));
}
@@ -563,9 +564,11 @@ export function inferStableStrategyFilterLevel(node: LogicNode): StableStrategyF
return 'relaxed';
}
if (id === 'ICHIMOKU_SANYAKU') {
const hasTrigger = conds.some(c => c.conditionType === 'CHIKOU_CROSS_ABOVE_PRIOR_CLOUD');
const hasMa = conds.some(c => c.indicatorType === 'MA' && c.rightField === maField(60));
const hasVolRatio = conds.some(c => c.conditionType === 'VOLUME_GT_MA_RATIO');
const hasVol = conds.some(c => c.indicatorType === 'VOLUME');
if (!hasTrigger) return 'balanced';
if (!hasMa && !hasVol) return 'relaxed';
if (hasVolRatio) return 'strict';
if (hasMa && hasVol) return 'balanced';