mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-02 01:27:24 -04:00
Compare commits
1 Commits
v0.2.0-alp
...
v0.2.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 1785f9b06f |
@@ -1,8 +1,12 @@
|
||||
import requests
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import requests
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
all_nasdaq_100_symbols = [
|
||||
@@ -42,4 +46,15 @@ if __name__ == "__main__":
|
||||
for symbol in all_nasdaq_100_symbols:
|
||||
get_daily_price(symbol)
|
||||
|
||||
get_daily_price("QQQ")
|
||||
get_daily_price("QQQ")
|
||||
|
||||
# Automatically run merge after fetching
|
||||
print("\n📦 Merging price data...")
|
||||
try:
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
merge_script = os.path.join(script_dir, "merge_jsonl.py")
|
||||
subprocess.run([sys.executable, merge_script], check=True)
|
||||
print("✅ Price data merged successfully")
|
||||
except Exception as e:
|
||||
print(f"⚠️ Failed to merge data: {e}")
|
||||
print(" Please run 'python merge_jsonl.py' manually")
|
||||
@@ -44,10 +44,10 @@ if [ -f "/app/data/merged.jsonl" ] && [ -s "/app/data/merged.jsonl" ]; then
|
||||
echo " To refresh data, delete /app/data/merged.jsonl and restart"
|
||||
else
|
||||
echo "📊 Fetching and merging price data..."
|
||||
# Run scripts from /app/scripts but output to /app/data
|
||||
# Run script from /app/scripts but output to /app/data
|
||||
# Note: get_daily_price.py now automatically calls merge_jsonl.py after fetching
|
||||
cd /app/data
|
||||
python /app/scripts/get_daily_price.py
|
||||
python /app/scripts/merge_jsonl.py
|
||||
cd /app
|
||||
fi
|
||||
|
||||
|
||||
2
main.sh
2
main.sh
@@ -10,8 +10,8 @@ echo "🚀 Launching AI Trader Environment..."
|
||||
|
||||
echo "📊 Now getting and merging price data..."
|
||||
cd ./data
|
||||
# Note: get_daily_price.py now automatically calls merge_jsonl.py after fetching
|
||||
python get_daily_price.py
|
||||
python merge_jsonl.py
|
||||
cd ../
|
||||
|
||||
echo "🔧 Now starting MCP services..."
|
||||
|
||||
Reference in New Issue
Block a user