ai 전략 agent 수정
This commit is contained in:
@@ -1464,17 +1464,6 @@ export default function StrategyEditorPage({
|
||||
[templateRows, templateSearch],
|
||||
);
|
||||
|
||||
const buildAiContext = useCallback((): AiStrategyContext => {
|
||||
const buyEncoded = encodeConditionForSave(buyEditorState);
|
||||
const sellEncoded = encodeConditionForSave(sellEditorState);
|
||||
return {
|
||||
buyCondition: buyEncoded,
|
||||
sellCondition: sellEncoded,
|
||||
signalTab: buySellTab(signalTab),
|
||||
candleType: currentEditorState.startMeta[START_NODE_ID]?.candleType,
|
||||
};
|
||||
}, [buyEditorState, sellEditorState, signalTab, currentEditorState]);
|
||||
|
||||
const applyAiStrategy = useCallback((buyDsl: LogicNode | null, sellDsl: LogicNode | null) => {
|
||||
if (editorMode === 'graph') layoutFlushRef.current?.();
|
||||
|
||||
@@ -1799,6 +1788,52 @@ export default function StrategyEditorPage({
|
||||
evalCommissionRate,
|
||||
]);
|
||||
|
||||
const buildAiContext = useCallback((): AiStrategyContext => {
|
||||
const buyEncoded = encodeConditionForSave(buyEditorState);
|
||||
const sellEncoded = encodeConditionForSave(sellEditorState);
|
||||
|
||||
const evaluation = evalBacktestSignals.length > 0 || signalTab === 'eval'
|
||||
? {
|
||||
market: evalMarket,
|
||||
timeframe: qbStrategyTimeframe,
|
||||
barCount: evalBars.length,
|
||||
evaluationBarCount: evalWindowMeta.evaluationBarCount,
|
||||
scanRunning: evalSignalScanRunning,
|
||||
signalsTotal: evalBacktestSignals.length,
|
||||
buyCount: evalBacktestSignals.filter(s => s.type === 'BUY').length,
|
||||
sellCount: evalBacktestSignals.filter(s => s.type === 'SELL').length,
|
||||
recentSignals: evalBacktestSignals.slice(-12).map(s => ({
|
||||
type: s.type,
|
||||
time: s.time,
|
||||
timeLabel: new Date(s.time * 1000).toLocaleString('ko-KR'),
|
||||
price: s.price,
|
||||
barIndex: s.barIndex,
|
||||
})),
|
||||
summary: evalAnalysisSummary ?? null,
|
||||
}
|
||||
: null;
|
||||
|
||||
return {
|
||||
buyCondition: buyEncoded,
|
||||
sellCondition: sellEncoded,
|
||||
signalTab: buySellTab(signalTab),
|
||||
candleType: currentEditorState.startMeta[START_NODE_ID]?.candleType,
|
||||
evaluation,
|
||||
};
|
||||
}, [
|
||||
buyEditorState,
|
||||
sellEditorState,
|
||||
signalTab,
|
||||
currentEditorState,
|
||||
evalBacktestSignals,
|
||||
evalMarket,
|
||||
qbStrategyTimeframe,
|
||||
evalBars,
|
||||
evalWindowMeta.evaluationBarCount,
|
||||
evalSignalScanRunning,
|
||||
evalAnalysisSummary,
|
||||
]);
|
||||
|
||||
const handleEvalSignalsChange = useCallback((signals: BacktestSignal[]) => {
|
||||
setEvalBacktestSignals(signals);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user