Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6cb1090
feat(image-analysis): Implement MLLM-based image feature computation …
vcfgv Dec 3, 2025
89eed10
feat(pipeline): introduce open and close methods for managing long-li…
vcfgv Dec 3, 2025
7d7bad5
feat(pipeline): refactor screenshot context management to use explici…
vcfgv Dec 3, 2025
75e0808
feat(pipeline): implement error handling for image feature fetching i…
vcfgv Dec 3, 2025
97032e1
feat(pipeline): enhance screenshot capture to return optional Image o…
vcfgv Dec 3, 2025
d32d4b2
feat(pipeline): update charts.json
vcfgv Dec 3, 2025
816f656
feat(pipeline): modify screenshot capture to create Image object with…
vcfgv Dec 3, 2025
00e381d
feat(pipeline): optimize page navigation and wait times in screenshot…
vcfgv Dec 3, 2025
c996f34
feat(pipeline): streamline Image object creation in screenshot capture
vcfgv Dec 3, 2025
4a2c551
feat(pipeline): remove default 1s candle configuration from pipeline
vcfgv Dec 3, 2025
61dea8a
feat(pipeline): introduce DataSourceImage model and update screenshot…
vcfgv Dec 4, 2025
c3cb0e2
feat(pipeline): enhance DataSourceImage to include instrument referen…
vcfgv Dec 4, 2025
95c2621
feat(pipeline): update screenshot capture methods to return a list of…
vcfgv Dec 4, 2025
ad28720
feat(pipeline): replace PlaywrightScreenshotDataSource with AggrScree…
vcfgv Dec 4, 2025
c2a2323
feat(pipeline): add TODO to include image metadata in MLLMImageFeatur…
vcfgv Dec 4, 2025
2e33c2f
feat(pipeline): introduce TradingViewScreenshotDataSource and normali…
vcfgv Dec 4, 2025
547c92c
fix path to charts.json in DefaultFeaturesPipeline to point to the co…
vcfgv Dec 4, 2025
77345aa
feat(pipeline): introduce AGGR_PROMPT for image analysis in MLLMImage…
vcfgv Dec 4, 2025
ce79d41
make format
vcfgv Dec 4, 2025
90ebd41
fix(pipeline): increase sleep duration after import to ensure modal c…
vcfgv Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
self._request = request
self.strategy_id = strategy_id
self.portfolio_service = portfolio_service
self._features_pipeline = features_pipeline
self.features_pipeline = features_pipeline
self._composer = composer
self._execution_gateway = execution_gateway
self._history_recorder = history_recorder
Expand Down Expand Up @@ -144,7 +144,7 @@ async def run_once(self) -> DecisionCycleResult:
if self._request.exchange_config.market_type == MarketType.SPOT:
portfolio.buying_power = max(0.0, float(portfolio.account_balance))

pipeline_result = await self._features_pipeline.build()
pipeline_result = await self.features_pipeline.build()
features = list(pipeline_result.features or [])
market_features = extract_market_snapshot_features(features)
digest = self._digest_builder.build(self._history_recorder.get_records())
Expand Down Expand Up @@ -612,7 +612,7 @@ async def close_all_positions(self) -> List[TradeHistoryEntry]:
market_features: List[FeatureVector] = []
if self._request.exchange_config.trading_mode == TradingMode.VIRTUAL:
try:
pipeline_result = await self._features_pipeline.build()
pipeline_result = await self.features_pipeline.build()
market_features = extract_market_snapshot_features(
pipeline_result.features or []
)
Expand Down
16 changes: 16 additions & 0 deletions python/valuecell/agents/common/trading/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ async def _run_background_decision(

# Call user hook for custom initialization
try:
# Initialize long-lived features resources if available
try:
await runtime.coordinator.features_pipeline.open()
except Exception:
logger.exception(
"Error initializing features pipeline resources for strategy {}",
strategy_id,
)

await self._on_start(runtime, request)
except Exception:
logger.exception("Error in _on_start hook for strategy {}", strategy_id)
Expand Down Expand Up @@ -336,6 +345,13 @@ async def _run_background_decision(
)

# Finalize: close resources and mark stopped/paused/error
try:
await runtime.coordinator.features_pipeline.close()
except Exception:
logger.exception(
"Error closing features pipeline resources for strategy {}",
strategy_id,
)
await controller.finalize(
runtime, reason=stop_reason, reason_detail=stop_reason_detail
)
Expand Down
1 change: 1 addition & 0 deletions python/valuecell/agents/common/trading/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
FEATURE_GROUP_BY_KEY = "group_by_key"
FEATURE_GROUP_BY_INTERVAL_PREFIX = "interval_"
FEATURE_GROUP_BY_MARKET_SNAPSHOT = "market_snapshot"
FEATURE_GROUP_BY_IMAGE_ANALYSIS = "image_analysis"
Loading