quick-stats

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Generate 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

参数

  • $0
    = symbol (e.g., SBIN, RELIANCE). Default: SBIN
  • $1
    = exchange. Default: NSE
  • $2
    = interval. Default: D
  • $0
    = 标的代码(例如:SBIN、RELIANCE)。默认值:SBIN
  • $1
    = 交易所。默认值:NSE
  • $2
    = 时间周期。默认值:D

Output Format

输出格式

Generate a single code block the user can paste into a Jupyter cell or run as a script. The code should:
  1. Fetch data from OpenAlgo (or yfinance as fallback)
  2. Run EMA 10/20 crossover
  3. 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%
  1. Show equity curve plot
生成用户可直接粘贴到Jupyter单元格或作为脚本运行的单个代码块。代码需实现以下功能:
  1. 从OpenAlgo获取数据(或使用yfinance作为备选)
  2. 运行10/20周期EMA交叉策略
  3. 打印简洁的结果摘要:
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%
  1. 展示权益曲线图表

Example Usage

示例用法

/quick-stats RELIANCE
/quick-stats HDFCBANK NSE 1h
/quick-stats RELIANCE
/quick-stats HDFCBANK NSE 1h