fix trend line training

This commit is contained in:
Dobromir Popov
2025-12-10 14:20:51 +02:00
parent 83bb688158
commit e200600a0a
4 changed files with 600 additions and 3845 deletions

View File

@@ -123,10 +123,12 @@ class AnnotationManager:
direction = 'SHORT'
profit_loss_pct = ((entry_price - exit_price) / entry_price) * 100
# Store complete market context for training
# Store only metadata in market_context - OHLCV data goes to database
market_context = {
'entry_state': entry_market_state or {},
'exit_state': exit_market_state or {}
'entry_timestamp': entry_point['timestamp'],
'exit_timestamp': exit_point['timestamp'],
'timeframes_available': list((entry_market_state or {}).keys()),
'data_stored_in_db': True # Indicates OHLCV data is in database, not JSON
}
annotation = TradeAnnotation(
@@ -141,8 +143,8 @@ class AnnotationManager:
)
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")
logger.info(f" Timeframes: {list((entry_market_state or {}).keys())} (OHLCV data stored in database)")
logger.info(f" Entry: {entry_point['timestamp']}, Exit: {exit_point['timestamp']}")
return annotation
def save_annotation(self, annotation: TradeAnnotation,