Install
openclaw skills install @sawyerieong-cpuai/qlib-msMicrosoft Qlib - AI-oriented Quantitative Investment Platform. Use when: (1) stock/financial data analysis, (2) quantitative trading strategy development, (3) backtesting trading strategies, (4) machine learning for finance, (5) portfolio optimization, (6) risk modeling, (7) fetching stock prices, (8) factor analysis, (9) model training for financial predictions. NOT for: general web scraping, non-financial data analysis, or when Python environment is unavailable.
openclaw skills install @sawyerieong-cpuai/qlib-msMicrosoft Qlib is an AI-oriented quantitative investment platform developed by Microsoft Research.
This skill is perfect for:
pip install qlib
import qlib
qlib.init()
from qlib.data import D
# Get stock features
df = D.features(
instruments=["AAPL", "MSFT"],
fields=["Close($close)", "Volume($volume)"],
freq="day"
)
from qlib.workflow import R
from qlib.contrib.evaluate import backtest_daily
# Create and run strategy
with R.start(experiment_name="my_strategy"):
# Strategy implementation
result = backtest_daily(start_time="2020-01-01", end_time="2023-12-31")
from qlib.contrib.model.gbdt import LGBModel
# Initialize model
model = LGBModel()
model.fit(dataset_train)
pred = model.predict(dataset_test)