Dragonfly
C++ 期货/期指 图表分析库
Install / Use
/learn @df-com/DragonflyREADME
dragonfly
C++ 期货/期指 图表分析库
系统要求:
- Visual Studio >= 2022
- Windows >= 10.
安装
- 安装
vcpkg - vcpkg install boost-filesystem boost-algorithm flatbuffers magic-enum spdlog SQLiteCpp protobuf cpp-httplib
使用
import dragonfly;
namespace df = dragonfly;
// 直接使用 dragonfly会自动下载数据, 自动存储到本地,自动更新
df::Chart chart("AU", df::Period::D1, system_clock::now() - std::chrono::days(30), system_clock::now());
// 指标
chart.macd(12, 26, 9);
chart.kdj(9, 3, 3);
chart.rsi(6);
// 更多指标请参考ind目录
合约信息
for (auto& spec : ContractSpec::instance().specs) {
spec.id; spec.contract_size;
}
回测(experimental)
using namespace experimental;
Account account;
Position pos;
pos.Open(Position::Long,chart,i,3232);
pos.Close(i+12,3300);
account.history.push_back(pos);
std::cout << account.win_rate();
std::cout << account.profit();
std::cout << account.max_drawdown();
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
