Skip to content

feat: Expose decision interval in Strategy Creation#499

Merged
DigHuang merged 4 commits into
ValueCell-ai:mainfrom
byronwang2005:feat/decide-interval
Dec 2, 2025
Merged

feat: Expose decision interval in Strategy Creation#499
DigHuang merged 4 commits into
ValueCell-ai:mainfrom
byronwang2005:feat/decide-interval

Conversation

@byronwang2005

@byronwang2005 byronwang2005 commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

📝 Pull Request Template

1. Related Issue

Closes # (issue number)

2. Type of Change (select one)

Type of Change: New Feature

3. Description

Summary

  • Adds an optional decide_interval field to the strategy creation flow so users can control decision frequency (in seconds), reducing token usage for virtual trading and tuning cadence for live trading.
  • Surfaces the field in Step 3 of the “Create Strategy” modal with validation and sensible defaults.
  • Improves form aesthetics by moving the decide_interval input to its own row, full width.

Rationale

  • Aligns the frontend with backend configuration TradingConfig.decide_interval (python/valuecell/agents/common/trading/models.py:230-234), enabling users to reduce virtual trading token consumption and control strategy decision cadence.
  • Provides a simple, user-visible knob without breaking existing flows.

Behavior & Compatibility

  • Backward compatible: if decide_interval is omitted, the backend default (60s) applies.
  • Frontend now validates and sends trading_config.decide_interval when provided.

4. Testing

  • I have tested this locally.
  • I have updated or added relevant tests.

5. Checklist

@vcfgv

vcfgv commented Dec 2, 2025

Copy link
Copy Markdown
Collaborator

Thanks for the contribution! If convenient, could you please:

  • Attach a screenshot showing the updated UI style.
  • Confirm whether this change is effective for all current StrategyAgents.

@byronwang2005

Copy link
Copy Markdown
Contributor Author
截屏2025-12-02 15 24 31
  • I tried placing three numeric input fields on the same line, but it got comically cramped.
  • Yes — it applies to all current StrategyAgents.
    -- Both PromptBasedStrategyAgent and GridStrategyAgent subclass BaseStrategyAgent, which drives the decision loop and sleeps based on trading_config.decide_interval.
    -- The interval is defined in TradingConfig with a default of 60 seconds and is always present after validation, so omitting it falls back to 60 seconds.

@vcfgv

vcfgv commented Dec 2, 2025

Copy link
Copy Markdown
Collaborator

@MXD66 @DigHuang any idea on this modified UI style

@byronwang2005

Copy link
Copy Markdown
Contributor Author

Next step is to consider displaying this parameter on the strategy detail page.

@DigHuang DigHuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to remove

Comment thread frontend/src/app/agent/components/strategy-items/forms/trading-strategy-form.tsx Outdated
Comment thread frontend/src/app/agent/components/strategy-items/forms/trading-strategy-form.tsx Outdated

@DigHuang DigHuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DigHuang
DigHuang merged commit 35491be into ValueCell-ai:main Dec 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants