वास्तविक रणनीति कार्यभार पर VectorBT संस्करणों की तुलना
सारांश
यह नोटबुक समर्थित वास्तविक-डेटा रणनीति वर्कलोड पर VectorBT Pro और VectorBT OSS की ML4T के साथ मौजूदा ऑडिट तुलना प्रस्तुत करती है। VectorBT के दोनों संस्करण ETF आवंटन, USD-कोटेड विदेशी मुद्रा आवंटन और US इक्विटी पैनल में शामिल हैं। Pro अनुबंध गुणकों और वायदा-शैली लीवरेज के साथ CME वायदा मामले को भी संभालता है। ऑडिट निष्पादन, मूल्यांकन टाइमस्टैम्प और खाते के मूल्यों की जाँच करता है तथा निष्पादन मूल्य और मात्रा की सटीकता को इस आवश्यकता से अलग रखता है कि मौद्रिक मूल्य सेंट तक मेल खाएँ।
दस्तावेज़ में मूल्यांकन के मेल खाते टाइमस्टैम्प वाली सात तुलना जाँचें पास हुईं। इसमें बताया गया है कि OSS में CME कॉन्ट्रैक्ट के लिए आवश्यक मूल मल्टीप्लायर और मार्जिन-खाता मॉडल नहीं है, जबकि क्रिप्टो परपेचुअल फ़ंडिंग और मार्जिन लेखांकन में दोनों में से किसी संस्करण का उपयोग नहीं किया गया। इसमें केवल इंजन का समय-मापन और एक सिंथेटिक स्केल तुलना भी दी गई है। समय-मापन में डेटा लोड और अन्य तैयारी शामिल नहीं हैं, इसलिए मापे गए अनुपात केवल ऑडिट किए गए कार्यभार और मशीनों पर लागू होते हैं; वे सामान्य गति रैंकिंग स्थापित नहीं करते। सिंथेटिक परिणाम उसके निश्चित लक्ष्य-ऑर्डर नुस्खे पर लागू है और बाहर रखे एसेट मॉडल के लिए समर्थन नहीं बढ़ाता।
मुख्य विचार
- ऑडिट चुने हुए वास्तविक-डेटा कार्यभार पर VectorBT संस्करणों की ML4T से तुलना करता है।
- दोनों संस्करण ETF, USD-कोटेड FX और US इक्विटी तुलनाओं में शामिल हैं।
- VectorBT Pro फ़्यूचर्स-विशिष्ट मल्टीप्लायर और मार्जिन सुविधाओं से CME मामले का समर्थन करता है।
- क्रिप्टो परपेचुअल फ़ंडिंग और मार्जिन के मामले में दोनों में से किसी संस्करण का उपयोग नहीं किया गया।
- केवल इंजन के समय-मापन और निश्चित नुस्खे पर आधारित पैमाने की तुलना के साक्ष्य का दायरा सीमित है।
टैग
पूरा पाठ
# VectorBT Pro and OSS on Current Case-Study Strategies
# VectorBT Pro and OSS on Current Case-Study Strategies
This notebook reports the VectorBT Pro and VectorBT OSS rows from the current real-strategy audit.
Required comparisons use ETF, CME futures, USD-quoted foreign-exchange, and US equity-panel target
streams where the pinned VectorBT edition supports the asset and accounting contract.
**Learning objectives**
- Compare VectorBT Pro and OSS with ML4T on supported real-data workloads
- Distinguish fill precision from the monetary unit used for account values
- Understand why VectorBT OSS is not used for the CME futures contract
- Read engine-only runtime evidence without treating it as a universal ranking
**Book reference**: Chapter 16, Section 16.3
## Setup
```python
"""Current VectorBT parity evidence."""
import json
import polars as pl
from IPython.display import display
from utils.paths import get_chapter_dir
```
```python
# Production defaults - Papermill injects overrides after this cell
ROUND_SECONDS = 3
```
```python
AUDIT_PATH = get_chapter_dir(16) / "resources" / "framework_parity_audit.json"
audit = json.loads(AUDIT_PATH.read_text(encoding="utf-8"))
FRAMEWORKS = ["vectorbt_pro", "vectorbt_oss"]
FRAMEWORK_NAMES = {
key: f"{audit['frameworks'][key]['display_name']} {audit['frameworks'][key]['version']}"
for key in FRAMEWORKS
}
CASE_NAMES = {
"etfs": "ETF allocation",
"cme_futures": "CME futures",
"crypto_perps_funding": "Crypto perpetual funding",
"fx_pairs": "FX allocation (USD-quoted pairs)",
"us_equities_panel": "US equity panel",
}
```
## 1. Required comparisons
```python
results = (
pl.DataFrame(audit["real_strategy_records"])
.filter(pl.col("framework").is_in(FRAMEWORKS))
.with_columns(
pl.col("case_study").replace_strict(CASE_NAMES).alias("strategy"),
pl.col("framework").replace_strict(FRAMEWORK_NAMES).alias("engine"),
)
.select(
"strategy",
"engine",
"status",
"fills",
"valuations",
"valuation_timestamps_match",
"equity_gap",
"equity_raw_gap",
"terminal_gap",
"terminal_raw_gap",
)
.sort("strategy", "engine")
)
assert results.height == 7
assert results.filter(pl.col("status") == "pass").height == 7
assert results["valuation_timestamps_match"].all()
display(results)
```
Both VectorBT editions participate in the ETF, USD-quoted foreign-exchange, and US equity-panel
comparisons. VectorBT Pro also supplies contract multipliers and futures-style leverage for the
CME comparison. Fill prices retain eight-decimal precision, quantities retain five-decimal
precision, and account monetary values must round to the same cent.
## 2. Unsupported asset models
```python
unsupported = (
pl.DataFrame(audit["unsupported_records"])
.filter(pl.col("framework").is_in(FRAMEWORKS))
.with_columns(
pl.col("case_study").replace_strict(CASE_NAMES).alias("strategy"),
pl.col("framework").replace_strict(FRAMEWORK_NAMES).alias("engine"),
)
.select("strategy", "engine", "reason")
.sort("strategy", "engine")
)
display(unsupported)
```
VectorBT OSS does not provide the native multiplier and margin-account model required by the CME
bundle. Neither edition is used to emulate crypto-perpetual funding and margin accounting.
## 3. Engine-only timing
Each correctness-passing VectorBT row has an engine-only timing record.
```python
timing = (
pl.DataFrame(audit["performance_records"])
.filter(pl.col("framework").is_in(FRAMEWORKS))
.with_columns(
pl.col("case_study").replace_strict(CASE_NAMES).alias("strategy"),
pl.col("framework").replace_strict(FRAMEWORK_NAMES).alias("engine"),
pl.col("framework_median_seconds").round(ROUND_SECONDS).alias("vectorbt_seconds"),
pl.col("ml4t_median_seconds").round(ROUND_SECONDS).alias("ml4t_seconds"),
pl.col("framework_to_ml4t_ratio").round(2).alias("vectorbt_div_ml4t"),
)
.select("strategy", "engine", "vectorbt_seconds", "ml4t_seconds", "vectorbt_div_ml4t")
)
assert timing.height == 7
display(timing)
```
The measured region excludes data loading, target construction, adapter preparation, and output
extraction. The observed ratios do not establish the same relationship for other datasets,
strategy mechanics, or machines.
## 4. Synthetic stress evidence
```python
stress = (
pl.DataFrame(audit["synthetic_stress"]["records"])
.filter(pl.col("framework").is_in(FRAMEWORKS))
.with_columns(pl.col("framework").replace_strict(FRAMEWORK_NAMES).alias("engine"))
.select("engine", "intents", "fills", "trades", "terminal_value", "status")
)
display(stress)
```
VectorBT Pro and OSS both pass the generated stress comparison against their matching ML4T
profiles. This establishes scale conformance for the fixed target-order recipe. It does not create
support for the excluded asset models.स्रोत के लाइसेंस के तहत श्रेय सहित पूरा पाठ दिखाया गया है। लाइसेंस: MIT
यह सारांश मूल स्रोत के आधार पर Stratmill के शोध एजेंट ने लिखा है; यह स्रोत की प्रति नहीं है।