annotations work and a re saved

This commit is contained in:
Dobromir Popov
2025-10-18 23:26:54 +03:00
parent 38d6a01f8e
commit 7646137f11
7 changed files with 771 additions and 60 deletions

View File

@@ -99,6 +99,12 @@ class AnnotationManager:
direction = 'SHORT'
profit_loss_pct = ((entry_price - exit_price) / entry_price) * 100
# Store complete market context for training
market_context = {
'entry_state': entry_market_state or {},
'exit_state': exit_market_state or {}
}
annotation = TradeAnnotation(
annotation_id=str(uuid.uuid4()),
symbol=symbol,
@@ -106,10 +112,13 @@ class AnnotationManager:
entry=entry_point,
exit=exit_point,
direction=direction,
profit_loss_pct=profit_loss_pct
profit_loss_pct=profit_loss_pct,
market_context=market_context
)
logger.info(f"Created annotation: {annotation.annotation_id} ({direction}, {profit_loss_pct:.2f}%)")
logger.info(f" Entry state: {len(entry_market_state or {})} timeframes")
logger.info(f" Exit state: {len(exit_market_state or {})} timeframes")
return annotation
def save_annotation(self, annotation: TradeAnnotation):