일목균형표 전략 추가
This commit is contained in:
@@ -75,6 +75,15 @@ import {
|
||||
inferInflection33FilterLevel,
|
||||
type Inflection33FilterLevel,
|
||||
} from '../utils/inflection33Strategy';
|
||||
import {
|
||||
buildIchimokuBbTree,
|
||||
isIchimokuBbPaletteValue,
|
||||
isIchimokuBbPairRoot,
|
||||
setIchimokuBbPairConfig,
|
||||
patchIchimokuBbPairInTree,
|
||||
inferIchimokuBbConfig,
|
||||
type IchimokuBbPairConfig,
|
||||
} from '../utils/ichimokuBbStrategy';
|
||||
import {
|
||||
buildStableStrategyTree,
|
||||
isStableStrategyPaletteValue,
|
||||
@@ -96,6 +105,7 @@ import {
|
||||
import StochPairNodeSettings from './strategyEditor/StochPairNodeSettings';
|
||||
import PriceExtremePairNodeSettings from './strategyEditor/PriceExtremePairNodeSettings';
|
||||
import Inflection33PairNodeSettings from './strategyEditor/Inflection33PairNodeSettings';
|
||||
import IchimokuBbPairNodeSettings from './strategyEditor/IchimokuBbPairNodeSettings';
|
||||
import StableStrategyPairNodeSettings from './strategyEditor/StableStrategyPairNodeSettings';
|
||||
import {
|
||||
emptySignalFlowLayout,
|
||||
@@ -731,6 +741,36 @@ export default function StrategyEditorPage({
|
||||
handleOrphansChange, handleRootChange, handleExtraRootsChange,
|
||||
]);
|
||||
|
||||
const applyIchimokuBbConfig = useCallback((pairNodeId: string, patch: Partial<IchimokuBbPairConfig>) => {
|
||||
if (currentOrphans.some(o => o.id === pairNodeId)) {
|
||||
handleOrphansChange(currentOrphans.map(o => (
|
||||
o.id === pairNodeId ? setIchimokuBbPairConfig(o, patch, DEF) : o
|
||||
)));
|
||||
return;
|
||||
}
|
||||
if (currentRoot) {
|
||||
const patched = patchIchimokuBbPairInTree(currentRoot, pairNodeId, patch, DEF);
|
||||
if (patched && patched !== currentRoot) {
|
||||
handleRootChange(patched);
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (const [startId, branch] of Object.entries(currentLayout.extraRoots ?? {})) {
|
||||
if (!branch) continue;
|
||||
const patched = patchIchimokuBbPairInTree(branch, pairNodeId, patch, DEF);
|
||||
if (patched && patched !== branch) {
|
||||
handleExtraRootsChange({
|
||||
...(currentLayout.extraRoots ?? {}),
|
||||
[startId]: patched,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, [
|
||||
currentRoot, currentOrphans, currentLayout.extraRoots, DEF,
|
||||
handleOrphansChange, handleRootChange, handleExtraRootsChange,
|
||||
]);
|
||||
|
||||
const applyStableStrategyFilterLevel = useCallback((pairNodeId: string, filterLevel: StableStrategyFilterLevel) => {
|
||||
if (currentOrphans.some(o => o.id === pairNodeId)) {
|
||||
handleOrphansChange(currentOrphans.map(o => (
|
||||
@@ -1355,17 +1395,20 @@ export default function StrategyEditorPage({
|
||||
const stochPair = isStochOverboughtPairPaletteValue(item.value);
|
||||
const priceExtremeBreakout = isPriceExtremeBreakoutPairPaletteValue(item.value);
|
||||
const inflection33 = isInflection33PaletteValue(item.value);
|
||||
const ichimokuBb = isIchimokuBbPaletteValue(item.value);
|
||||
const stableStrategy = isStableStrategyPaletteValue(item.value);
|
||||
const composite = item.kind === 'composite' && !stochPair && !priceExtremeBreakout && !inflection33 && !stableStrategy;
|
||||
const composite = item.kind === 'composite' && !stochPair && !priceExtremeBreakout && !inflection33 && !ichimokuBb && !stableStrategy;
|
||||
const newNode = stochPair
|
||||
? buildStochOverboughtPairTree(item.secondaryIndicator ?? 'CCI', DEF)
|
||||
: priceExtremeBreakout
|
||||
? buildPriceExtremeBreakoutTree(item.value, DEF)
|
||||
: inflection33
|
||||
? buildInflection33Tree(item.value, DEF)
|
||||
: stableStrategy
|
||||
? buildStableStrategyTree(item.value, DEF)
|
||||
: makeNode('indicator', item.value, signalTab, DEF, composite ? { composite: true } : undefined);
|
||||
: ichimokuBb
|
||||
? buildIchimokuBbTree(item.value, DEF)
|
||||
: stableStrategy
|
||||
? buildStableStrategyTree(item.value, DEF)
|
||||
: makeNode('indicator', item.value, signalTab, DEF, composite ? { composite: true } : undefined);
|
||||
if (!newNode) return;
|
||||
handleEditorStateChange(prev => {
|
||||
const root = prev.root;
|
||||
@@ -2143,6 +2186,17 @@ export default function StrategyEditorPage({
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{selectedLogicNode && isIchimokuBbPairRoot(selectedLogicNode) && selectedLogicNode.ichimokuBbPair && (
|
||||
<div className="se-node-config-bar se-node-config-bar--ichimoku-bb">
|
||||
<span className="se-node-config-label">일목×볼린저</span>
|
||||
<IchimokuBbPairNodeSettings
|
||||
variant="inline"
|
||||
config={inferIchimokuBbConfig(selectedLogicNode)}
|
||||
onChange={patch => applyIchimokuBbConfig(selectedLogicNode.id, patch)}
|
||||
onClose={() => {}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{selectedLogicNode && isStableStrategyPairRoot(selectedLogicNode) && selectedLogicNode.stableStrategyPair && (
|
||||
<div className="se-node-config-bar se-node-config-bar--stable-strategy">
|
||||
<span className="se-node-config-label">추천 전략 필터</span>
|
||||
|
||||
Reference in New Issue
Block a user