-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 1.8 KB
/
Copy pathagent-backtest.yml
File metadata and controls
65 lines (58 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Deterministic Backtest
on:
workflow_dispatch:
inputs:
start_date:
description: 'Start date (YYYY-MM-DD)'
required: true
type: string
default: '2025-01-02'
end_date:
description: 'End date (YYYY-MM-DD)'
required: true
type: string
default: '2025-12-31'
universe:
description: 'Stock universe (strategy name or codes)'
required: true
type: string
default: 'default'
capital:
description: 'Initial capital'
required: false
type: string
default: '100000'
jobs:
backtest:
runs-on: [self-hosted, linux]
timeout-minutes: 600 # up to 10 hours for full Agent backtest
steps:
- uses: actions/checkout@v4
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Run deterministic backtest
run: |
openalphastack tools backtest_runner \
--start "${{ inputs.start_date }}" \
--end "${{ inputs.end_date }}" \
--universe "${{ inputs.universe }}" \
--capital "${{ inputs.capital }}"
- name: Generate summary report
if: always()
run: |
RUN_ID=$(ls -t data/output/backtest_* | head -1 | xargs basename)
echo "Run ID: $RUN_ID"
openalphastack tools daily_report "$RUN_ID" --all
echo ""
echo "===== FINAL STATS ====="
openalphastack tools daily_report "$RUN_ID"
- name: Upload backtest artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: backtest-output-${{ github.run_id }}
path: data/output/backtest_*/
retention-days: 30