quick-stats
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGenerate a quick inline backtest and print stats. Do NOT create a file - output code directly for the user to run or execute in a notebook.
生成快速在线回测并打印统计数据。请勿创建文件——直接输出代码供用户在笔记本中运行或执行。
Arguments
参数
- = symbol (e.g., SBIN, RELIANCE). Default: SBIN
$0 - = exchange. Default: NSE
$1 - = interval. Default: D
$2
- = 标的代码(例如:SBIN、RELIANCE)。默认值:SBIN
$0 - = 交易所。默认值:NSE
$1 - = 时间周期。默认值:D
$2
Output Format
输出格式
Generate a single code block the user can paste into a Jupyter cell or run as a script. The code should:
- Fetch data from OpenAlgo (or yfinance as fallback)
- Run EMA 10/20 crossover
- Print a compact results summary:
Symbol: SBIN | Exchange: NSE | Interval: D
Strategy: EMA 10/20 Crossover
Period: 2022-01-01 to 2025-02-25
-------------------------------------------
Total Return: 45.23%
Sharpe Ratio: 1.45
Sortino Ratio: 2.01
Max Drawdown: -12.34%
Win Rate: 42.5%
Profit Factor: 1.67
Total Trades: 28
Avg Win: 3.2%
Avg Loss: -1.8%
Best Trade: 15.2%
Worst Trade: -8.1%- Show equity curve plot
生成用户可直接粘贴到Jupyter单元格或作为脚本运行的单个代码块。代码需实现以下功能:
- 从OpenAlgo获取数据(或使用yfinance作为备选)
- 运行10/20周期EMA交叉策略
- 打印简洁的结果摘要:
Symbol: SBIN | Exchange: NSE | Interval: D
Strategy: EMA 10/20 Crossover
Period: 2022-01-01 to 2025-02-25
-------------------------------------------
Total Return: 45.23%
Sharpe Ratio: 1.45
Sortino Ratio: 2.01
Max Drawdown: -12.34%
Win Rate: 42.5%
Profit Factor: 1.67
Total Trades: 28
Avg Win: 3.2%
Avg Loss: -1.8%
Best Trade: 15.2%
Worst Trade: -8.1%- 展示权益曲线图表
Example Usage
示例用法
/quick-stats RELIANCE/quick-stats HDFCBANK NSE 1h/quick-stats RELIANCE/quick-stats HDFCBANK NSE 1h