Skip to content

Commit d85af0a

Browse files
feat(adapter): implement BaoStockAdapter for SSE & SZSE (#420)
## 📝 Pull Request Template ### 1. Related Issue #196 Not resolved, just enhancement, 'Historical price data not available for'SSE:000001' is fixed. ### 2. Type of Change (select one) New Feature ### 3. Description Add a more stable and free [datasource](http://www.baostock.com/) which supports SSE & SZSE's stock and index. (No real-time price because BaoStock does not support it). **Be careful, one IP can only request APIs 100,000 times per day**(or you will be blocked), but I didn't set a limit or use cache. ### 4. Testing - [x] I have tested this locally. - [ ] I have updated or added relevant tests. ### 5. Checklist - [x] I have read the [Code of Conduct](./CODE_OF_CONDUCT.md) - [x] I have followed the [Contributing Guidelines](./CONTRIBUTING.md) - [x] My changes follow the project's coding style --------- Co-authored-by: hazeone <709547807@qq.com>
1 parent 3452732 commit d85af0a

File tree

11 files changed

+1323
-295
lines changed

11 files changed

+1323
-295
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,8 @@ lancedb
228228
logs
229229
.knowledge
230230
.txt
231+
232+
# Local configs
233+
python/configs/
234+
231235
*.key

README.ja.md

Lines changed: 47 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ ValueCellは、金融アプリケーション向けのコミュニティ主導
3737

3838
ポートフォリオ管理を支援するトップクラスの投資エージェントチームを提供します。これにより、銘柄選別、リサーチ、追跡、および取引の完了を支援します。
3939

40+
機密情報はすべてローカルデバイスに保存され、コアデータのセキュリティが確保されます。
41+
4042
Discord コミュニティへのご参加をお待ちしています。使用中に発生した問題についてのご意見をお寄せいただき、さらに多くの開発者にご参加いただけますようお願いします🔥🔥🔥
4143

4244
>注意: ValueCellチームメンバーがコミュニティ参加者に主動的に連絡することはありません。このプロジェクトは技術交流のみを目的としています。投資にはリスクが伴います。⚠️
@@ -84,89 +86,27 @@ p align="center">
8486

8587
# クイックスタート
8688

87-
## ユーザー向け
89+
## 新規ユーザー向け
8890

8991
最新の ValueCell アプリケーション(MacOS または Windows 用)を GitHub の[リリースページ](https://github.com/ValueCell-ai/valuecell/releases)からダウンロードできます。また、公式ウェブサイト [https://valuecell.ai](https://valuecell.ai) からもダウンロードできます。
9092

9193
インストール後、初回使用時に、お好みのモデルプロバイダーを設定してください。アプリケーション内の指示またはドキュメントを参照してください。
9294

93-
## 開発者向け
94-
ValueCellは包括的なWebインターフェースを備えたPythonベースのアプリケーションです。このガイドに従って、アプリケーションを効率的にセットアップして実行してください。
95-
96-
### 前提条件
97-
98-
最適なパフォーマンスと効率的な開発のために、以下のツールのインストールを推奨します:
99-
100-
**[uv](https://docs.astral.sh/uv/getting-started/installation/)** - Rustで構築された超高速Pythonパッケージおよびプロジェクトマネージャー
101-
**[bun](https://github.com/oven-sh/bun#install)** - 高性能JavaScript/TypeScriptツールキット(ランタイム、バンドラー、テストランナー、パッケージマネージャーを含む)
102-
103-
### インストール
104-
105-
1. **リポジトリのクローン**
106-
107-
```bash
108-
git clone https://github.com/ValueCell-ai/valuecell.git
109-
cd valuecell
110-
```
111-
112-
2. **環境変数の設定**
113-
114-
```bash
115-
cp .env.example .env
116-
```
117-
118-
APIキーと設定を`.env`ファイルに記入してください。この設定ファイルはすべてのエージェント間で共有されます。設定の詳細については、[設定ガイド](docs/CONFIGURATION_GUIDE.md) をご参照ください。
119-
120-
## 設定
121-
122-
詳細な設定情報については、[CONFIGURATION_GUIDE](./docs/CONFIGURATION_GUIDE.md)を参照してください。
123-
124-
### モデルプロバイダー
125-
`.env`ファイルを編集して、お好みのモデルプロバイダーを設定してください:
126-
127-
- **シンプルセットアップ**: モデルプロバイダーの API キーのみを設定してください
128-
129-
- **高度な設定**: リサーチタイプのエージェントの場合、より多くの環境変数を設定する必要があります。詳細は `.env.example` ファイルを参照してください
130-
131-
- **公式推奨**: OpenRouter + 埋め込みモデルを提供する任意のサプライヤーを設定してください。理由:プロバイダー間のモデルの高速切り替えが可能であり、RAG+Memory AI機能を提供します。
132-
133-
## アプリケーションの実行
134-
135-
完全なアプリケーション(フロントエンド、バックエンド、エージェント)を起動します:
136-
137-
### Linux / Macos
138-
```bash
139-
bash start.sh
140-
```
141-
142-
### Windows (PowerShell)
143-
```powershell
144-
.\start.ps1
145-
```
146-
147-
## インターフェースへのアクセス
148-
149-
- **Web UI**: ブラウザで[http://localhost:1420](http://localhost:1420)にアクセス
150-
- **ログ**: バックエンドサービスと個々のエージェントの詳細な実行時情報については、`logs/{timestamp}/*.log`でアプリケーションログを確認
151-
152-
### 次のステップ
153-
154-
アプリケーションが起動したら、WebインターフェースでValueCellの機能を操作して探索できます。
155-
156-
## ライブ取引
95+
### ライブ取引
15796

15897
- AIモデルの設定: Webインターフェースから AI モデルの API キーを追加します。
15998
- 取引所の設定: Binance/HyperLiquid/OKX/Coinbase... の API 認証情報を設定します。
16099
- ストラテジー作成: AIモデルと取引所を組み合わせてカスタム戦略を作成します。
161100
- モニタリング&コントロール: 戦略の開始/停止を行い、パフォーマンスをリアルタイムで監視します。
101+
- 注意:現在は先物取引のみをサポートしています(現物は1X先物として実装)。先物口座に十分な残高があることを確認してください
162102

163-
### サポートされている取引所
103+
#### サポートされている取引所
164104

165105
| 取引所 | 備考 | ステータス |
166106
| --- | --- | --- |
167-
| **Binance** | 国際サイト [binance.com](binance.com) のみサポート(米国サイトは非対応)。USDT-M 先物(USDT証拠金契約)を使用します。先物口座に十分な USDT 残高があることを確認してください。取引ペア形式: `BTC/USDT` | ✅ テスト済み |
168-
| **Hyperliquid** | 証拠金通貨として USDC のみサポートします。メインウォレットアドレス + API ウォレット秘密鍵認証を使用します([APIタブ](https://app.hyperliquid.xyz/API)から申請)。成行注文は自動的に IoC 指値注文に変換されます。取引ペア形式は手動で `SYMBOL/USDC` に調整する必要があります(例: `WIF/USDC`)。 | ✅ テスト済み |
169-
| **OKX** | 認証には API Key、Secret、Passphrase が必要です。USDT証拠金契約をサポートします。取引ペア形式: `BTC/USDT` | ✅ テスト済み |
107+
| **Binance** | 国際サイト [binance.com](binance.com) のみサポート(米国サイトは非対応)。USDT-M 先物(USDT証拠金契約)を使用します。先物口座に十分な USDT 残高があることを確認してください。取引ペア形式: `BTC/USDT`。注意:無期限先物口座の残高が0でないことを確認してください。API申請時はIPホワイトリストを追加してください(検索エンジンで`My IP`を検索して確認) | ✅ テスト済み |
108+
| **Hyperliquid** | 証拠金通貨として USDC のみサポートします。メインウォレットアドレス + API ウォレット秘密鍵認証を使用します([APIタブ](https://app.hyperliquid.xyz/API)から申請)。成行注文は自動的に IoC 指値注文に変換されます。取引ペア形式は手動で `SYMBOL/USDC` に調整する必要があります(例: `WIF/USDC`)。メインウォレットアドレス+APIウォレット秘密鍵で設定。1取引あたり最低10U | ✅ テスト済み |
109+
| **OKX** | 認証には API Key、Secret、Passphrase(OKXアカウントパスワード)が必要です。USDT証拠金契約をサポートします。取引ペア形式: `BTC/USDT` | ✅ テスト済み |
170110
| Coinbase | USDT証拠金契約をサポートします。Coinbase International はまだサポートされていません。 | 🟡 部分的にテスト済み |
171111
| Gate.io | USDT証拠金契約をサポートします。API Key と Secret が必要です。 | 🟡 部分的にテスト済み |
172112
| MEXC | USDT証拠金契約をサポートします。API Key と Secret が必要です。 | 🟡 部分的にテスト済み |
@@ -183,6 +123,7 @@ bash start.sh
183123
- アカウントの安全を確保するために、API キーを定期的にリセットする必要があります。
184124

185125
---
126+
186127
**注意**: アプリケーションを実行する前に、すべての前提条件がインストールされ、環境変数が適切に設定されていることを確認してください。
187128
長期間更新がない場合は、ローカルデータを削除して再起動できます:
188129
- LanceDB ディレクトリ(システムアプリディレクトリに保存。`.env` と同じ場所):
@@ -199,12 +140,48 @@ bash start.sh
199140
- Windows: `%APPDATA%\\ValueCell\\valuecell.db`
200141

201142

202-
# 開発者
143+
## 開発者
203144

204145
すべての開発者をDiscordディスカッショングループに招待し、コミュニティのRoadMapと将来のコミュニティコントリビューター権利計画について定期的に交流します
205146

206147
開発プロセスと標準の詳細については、[CONTRIBUTING.md](.github/CONTRIBUTING.md)を参照してください
207148

149+
ValueCellは包括的なWebインターフェースを備えたPythonベースのアプリケーションで、マルチプラットフォーム展開をサポートしています。以下の設定に従って、すぐに始めることができます。
150+
151+
## リポジトリのクローン
152+
153+
```bash
154+
git clone https://github.com/ValueCell-ai/valuecell.git
155+
cd valuecell
156+
```
157+
158+
## アプリケーションの実行
159+
160+
完全なアプリケーション(フロントエンド、バックエンド、エージェント)を起動します:
161+
162+
### Linux / Macos
163+
```bash
164+
bash start.sh
165+
```
166+
167+
### Windows (PowerShell)
168+
```powershell
169+
.\start.ps1
170+
```
171+
172+
### インターフェースへのアクセス
173+
174+
- **Web UI**: ブラウザで[http://localhost:1420](http://localhost:1420)にアクセス
175+
- **ログ**: ターミナルで直接アプリケーションログを確認し、バックエンドサービスと個々のエージェントの詳細な実行時情報を取得
176+
177+
### 次のステップ
178+
179+
アプリケーションが起動したら、WebインターフェースでValueCellの機能を操作して探索できます。
180+
181+
### 設定
182+
183+
詳細な設定情報については、[CONFIGURATION_GUIDE](./docs/CONFIGURATION_GUIDE.md)を参照してください
184+
208185
# ロードマップ
209186

210187
## 🤖 強化されたエージェント機能

README.md

Lines changed: 54 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ ValueCell is a community-driven, multi-agent platform for financial applications
3737

3838
It provides a team of TOP investment Agents to help you with stock selection, research, tracking, and even trading.
3939

40+
The system keeps all your sensitive information stored locally on your device, ensuring core data security.
41+
4042
Welcome to join our Discord community to share feedback and issues you encounter, and invite more developers to contribute 🔥🔥🔥
4143

4244
>Note: ValueCell team members will never proactively contact community participants. This project is for technical exchange only. Investing involves risk. ⚠️
@@ -85,93 +87,27 @@ Welcome to join our Discord community to share feedback and issues you encounter
8587

8688
# Quick Start
8789

88-
## For Users
90+
## New Users
8991

9092
To get started quickly, download the latest ValueCell application for MacOS or Windows from the [Releases page](https://github.com/ValueCell-ai/valuecell/releases) on GitHub. You may also download the application from our official website: [https://valuecell.ai](https://valuecell.ai).
9193

9294
After installation, please configure your preferred model provider before using ValueCell for the first time. Refer to the instructions in the application or documentation as needed.
9395

94-
## For Developers
95-
ValueCell is a Python-based application featuring a comprehensive web interface. Follow this guide to set up and run the application efficiently.
96-
97-
### Prerequisites
98-
99-
For optimal performance and streamlined development, we recommend installing the following tools:
100-
101-
**[uv](https://docs.astral.sh/uv/getting-started/installation/)** - Ultra-fast Python package and project manager built in Rust
102-
**[bun](https://github.com/oven-sh/bun#install)** - High-performance JavaScript/TypeScript toolkit with runtime, bundler, test runner, and package manager
103-
104-
### Installation
105-
106-
1. **Clone the repository**
107-
108-
```bash
109-
git clone https://github.com/ValueCell-ai/valuecell.git
110-
cd valuecell
111-
```
112-
113-
2. **Configure environment variables**
114-
115-
```bash
116-
cp .env.example .env
117-
```
118-
119-
Edit the `.env` file with your API keys and preferences. This configuration file is shared across all agents. See [Configuration Guide](docs/CONFIGURATION_GUIDE.md) for details.
120-
121-
## Configuration
122-
123-
More detailed configuration information can be found at [CONFIGURATION_GUIDE](./docs/CONFIGURATION_GUIDE.md)
124-
125-
### Model Providers
126-
Configure your preferred model providers by editing the `.env` file:
127-
128-
- **Simple Setup**: Just configure the model provider's API Key
129-
130-
- **Advanced Configuration**: For research-type agents, you need to configure more environment variables. Please refer to the `.env.example` file for details.
131-
132-
- **Official Recommendation**: Configure OpenRouter + any supplier that provides embedding models. Reason: This enables quick model switching across providers and provides RAG+Memory AI capabilities
133-
134-
135-
Choose your preferred models and providers based on your requirements and preferences.
136-
137-
## Running the Application
138-
139-
Launch the complete application (frontend, backend, and agents):
140-
141-
### Linux / Macos
142-
```bash
143-
bash start.sh
144-
```
145-
146-
### Windows (PowerShell)
147-
```powershell
148-
.\start.ps1
149-
```
150-
151-
## Accessing the Interface
152-
153-
- **Web UI**: Navigate to [http://localhost:1420](http://localhost:1420) in your browser
154-
- **Logs**: Monitor application logs at `logs/{timestamp}/*.log` for detailed runtime information of backend services and individual agents
155-
156-
157-
## Next Steps
158-
159-
Once the application is running, you can explore the web interface to interact with ValueCell's features and capabilities.
160-
161-
## Live Trading
96+
### Live Trading
16297

16398
- Configure AI Models: Add your AI Model API Key through the web interface.
16499
- Configure Exchanges: Set up Binance/HyperLiquid/OKX/Coinbase... API credentials
165100
- Create Strategies: Combine AI model with exchange to create custom strategies
166101
- Monitor & Control: Start/stop traders and monitor performance in real-time
102+
- Note: Currently only supports contract trading (spot is implemented as 1X contracts), so please ensure your contract account has sufficient balance
167103

168-
### Supported Exchanges
104+
#### Supported Exchanges
169105

170106
| Exchange | Notes | Status |
171107
| --- | --- | --- |
172-
| **Binance** | Only supports international site [binance.com](binance.com), not US site. Uses USDT-M futures (USDT-margined contracts). Ensure your futures account has sufficient USDT balance. Trading pair format: `BTC/USDT` | ✅ Tested |
173-
| **Hyperliquid** | Only supports USDC as margin currency. Uses your main wallet address + API wallet private key authentication (use [API tab](https://app.hyperliquid.xyz/API) to apply). Market orders are automatically converted to IoC limit orders. Trading pair format must be manually adjusted to `SYMBOL/USDC` (e.g., `WIF/USDC`) | ✅ Tested |
174-
| **OKX** | Requires API Key, Secret, and Passphrase for authentication. Supports USDT-margined contracts. Trading pair format: `BTC/USDT` | ✅ Tested |
108+
| **Binance** | Only supports international site [binance.com](binance.com), not US site. Uses USDT-M futures (USDT-margined contracts). Ensure your futures account has sufficient USDT balance. Trading pair format: `BTC/USDT`. Note: Ensure perpetual contract account balance is not 0. When applying for API, add IP whitelist by searching `My IP` in search engine | ✅ Tested |
109+
| **Hyperliquid** | Only supports USDC as margin currency. Uses your main wallet address + API wallet private key authentication (use [API tab](https://app.hyperliquid.xyz/API) to apply). Market orders are automatically converted to IoC limit orders. Trading pair format must be manually adjusted to `SYMBOL/USDC` (e.g., `WIF/USDC`). Configure with main wallet address + API wallet private key. Minimum 10U per trade | ✅ Tested |
110+
| **OKX** | Requires API Key, Secret, and Passphrase (OKX account password) for authentication. Supports USDT-margined contracts. Trading pair format: `BTC/USDT` | ✅ Tested |
175111
| Coinbase | Supports USDT-margined contracts. Coinbase International is not yet supported | 🟡 Partially Tested |
176112
| Gate.io | Supports USDT-margined contracts. Requires API Key and Secret | 🟡 Partially Tested |
177113
| MEXC | Supports USDT-margined contracts. Requires API Key and Secret | 🟡 Partially Tested |
@@ -188,26 +124,64 @@ Once the application is running, you can explore the web interface to interact w
188124
- To ensure your account safety, you need to reset your API keys regularly.
189125

190126
---
127+
191128
**Note**: Before running the application, ensure all prerequisites are installed and environment variables are properly configured. If it has been a long time since the last update, you can delete local data stores and start fresh:
192-
- LanceDB directory (stored in your system application directory):
129+
- LanceDB directory (stored in your system application directory, same path as `.env`):
193130
- macOS: `~/Library/Application Support/ValueCell/lancedb`
194131
- Linux: `~/.config/valuecell/lancedb`
195-
- Windows: `%APPDATA%\ValueCell\lancedb`
196-
- Knowledge directory (stored in your system application directory):
132+
- Windows: `%APPDATA%\\ValueCell\\lancedb`
133+
- Knowledge directory (stored in your system application directory, same path as `.env`):
197134
- macOS: `~/Library/Application Support/ValueCell/.knowledge`
198135
- Linux: `~/.config/valuecell/.knowledge`
199-
- Windows: `%APPDATA%\ValueCell\.knowledge`
200-
- SQLite database file (stored in your system application directory):
136+
- Windows: `%APPDATA%\\ValueCell\\.knowledge`
137+
- SQLite database file (stored in your system application directory, same path as `.env`):
201138
- macOS: `~/Library/Application Support/ValueCell/valuecell.db`
202139
- Linux: `~/.config/valuecell/valuecell.db`
203-
- Windows: `%APPDATA%\ValueCell\valuecell.db`
140+
- Windows: `%APPDATA%\\ValueCell\\valuecell.db`
141+
204142

205-
# Developers
143+
## Developers
206144

207145
We sincerely invite all developers to join our Discord discussion group, where we regularly share the community roadmap and upcoming contributor benefit plans.
208146

209147
Details on development processes and standards are provided below:[CONTRIBUTING.md](.github/CONTRIBUTING.md)
210148

149+
ValueCell is a Python-based application with a comprehensive web interface, supporting multi-platform deployment. Follow the configuration below to get started quickly.
150+
151+
## Clone Repository
152+
153+
```bash
154+
git clone https://github.com/ValueCell-ai/valuecell.git
155+
cd valuecell
156+
```
157+
158+
## Running the Application
159+
160+
Launch the complete application (frontend, backend, and agents):
161+
162+
### Linux / Macos
163+
```bash
164+
bash start.sh
165+
```
166+
167+
### Windows (PowerShell)
168+
```powershell
169+
.\start.ps1
170+
```
171+
172+
### Accessing the Interface
173+
174+
- **Web UI**: Navigate to [http://localhost:1420](http://localhost:1420) in your browser
175+
- **Logs**: View application logs directly in the terminal for detailed runtime information of backend services and individual agents
176+
177+
### Next Steps
178+
179+
Once the application is running, you can explore the web interface to interact with ValueCell's features and capabilities.
180+
181+
### Configuration
182+
183+
More detailed configuration information can be found at [CONFIGURATION_GUIDE](./docs/CONFIGURATION_GUIDE.md)
184+
211185
# Roadmap
212186

213187
## 🤖 Enhanced Agent Capabilities

0 commit comments

Comments
 (0)