Create an interactive Plotly chart for a technical indicator on a symbol.
Arguments
Parse $ARGUMENTS as: indicator symbol exchange interval
$0 = indicator name (e.g., ema, rsi, macd, supertrend, bbands, adx, stochastic, ichimoku, obv, vwap). Default: ema
$1 = symbol (e.g., SBIN, RELIANCE, NIFTY, AAPL). Default: SBIN
$2 = exchange (e.g., NSE, BSE, NFO, NSE_INDEX). Default: NSE. For US symbols use: YFINANCE
$3 = interval (e.g., D, 1h, 5m). Default: D
If no arguments, ask the user which indicator and symbol they want.
Instructions
- Read the indicator-expert skill rules for reference patterns
- Create
charts/{indicator_name}/ directory if it doesn't exist (on-demand)
- Create a
.py file in charts/{indicator_name}/ named {symbol}_{indicator}_chart.py
- Use the matching template from
rules/assets/{indicator}_chart/chart.py as starting point (if available)
- The script must:
- Load
.env from project root using find_dotenv()
- Fetch data via OpenAlgo
client.history() (or yfinance for US symbols)
- Normalize data: convert index to datetime, sort, strip timezone
- Compute the indicator using
openalgo.ta
- Create a Plotly chart with
template="plotly_dark" and xaxis_type="category"
- Overlay indicators (EMA, Bollinger, Supertrend, Ichimoku) go on the candlestick panel
- Subplot indicators (RSI, MACD, Stochastic, ADX, Volume, OBV) go below in separate panels
- Use
make_subplots for multi-panel layouts
- Add horizontal reference lines where appropriate (RSI 30/70, Stochastic 20/80)
- Print a plain-language explanation of the current indicator reading
- Save chart as HTML:
{symbol}_{indicator}_chart.html
- Show chart with
fig.show()
- Never use icons/emojis in code or output
Indicator Chart Types
Overlay Indicators (on candlestick panel)
| Indicator |
Chart Type |
| ema, sma, wma, dema, tema, hma |
Line overlay |
| bbands |
Fill-between bands + midline |
| supertrend |
Color-coded line (green=up, red=down) |
| ichimoku |
5 lines + cloud fill |
| keltner, donchian |
Fill-between channels |
| sar |
Dot markers above/below price |
| ma-envelopes |
Upper/lower band lines |
Subplot Indicators (separate panel below)
| Indicator |
Chart Type |
| rsi |
Line + horizontal 30/70 zones |
| macd |
Line + signal + histogram bars |
| stochastic |
K% + D% lines + 20/80 zones |
| adx |
DI+, DI-, ADX lines + 25 threshold |
| cci |
Line + horizontal +100/-100 zones |
| williams_r |
Line + -20/-80 zones |
| obv |
Line (cumulative) |
| mfi |
Line + 20/80 zones |
| volume |
Bar chart (green/red by price direction) |
| atr |
Line (volatility) |
Multi-Indicator Charts
If user asks for "multi" or multiple indicators, create a comprehensive multi-panel chart with:
- Row 1: Candlestick + EMA overlays
- Row 2: RSI(14)
- Row 3: MACD(12,26,9)
- Row 4: Volume bars
Signal Markers
If the indicator generates clear buy/sell signals (e.g., crossover, supertrend direction change), add triangle markers:
- Buy: green triangle-up markers
- Sell: red triangle-down markers
Data Periods
| Interval |
Default Lookback |
| D |
1 year (365 days) |
| 1h |
6 months (180 days) |
| 15m, 30m |
3 months (90 days) |
| 5m |
1 month (30 days) |
| 1m |
7 days |
Plain-Language Explanation
After creating the chart, print a brief explanation:
SBIN — RSI(14) Analysis
Current RSI: 42.3
Interpretation: Neutral zone (between 30-70). Neither overbought nor oversold.
Trend: RSI has been declining from 65 over the past 5 bars, suggesting weakening momentum.
Example Usage
/indicator-chart ema SBIN NSE D
/indicator-chart rsi RELIANCE NSE D
/indicator-chart macd AAPL YFINANCE D
/indicator-chart supertrend NIFTY NSE_INDEX D
/indicator-chart multi SBIN NSE D
/indicator-chart bbands INFY NSE 1h
1---2name: indicator-chart3description: Chart any technical indicator on a symbol using Plotly. Creates interactive dark-themed charts with candlestick, overlays, and subplots. Supports all 100+ openalgo.ta indicators.4---5
6Create an interactive Plotly chart for a technical indicator on a symbol.
7
8## Arguments
9
10Parse `$ARGUMENTS` as: indicator symbol exchange interval
11
12- `$0` = indicator name (e.g., ema, rsi, macd, supertrend, bbands, adx, stochastic, ichimoku, obv, vwap). Default: ema
13- `$1` = symbol (e.g., SBIN, RELIANCE, NIFTY, AAPL). Default: SBIN
14- `$2` = exchange (e.g., NSE, BSE, NFO, NSE_INDEX). Default: NSE. For US symbols use: YFINANCE
15- `$3` = interval (e.g., D, 1h, 5m). Default: D
16
17If no arguments, ask the user which indicator and symbol they want.
18
19## Instructions
20
211. Read the indicator-expert skill rules for reference patterns
222. Create `charts/{indicator_name}/` directory if it doesn't exist (on-demand)
233. Create a `.py` file in `charts/{indicator_name}/` named `{symbol}_{indicator}_chart.py`
244. Use the matching template from `rules/assets/{indicator}_chart/chart.py` as starting point (if available)
255. The script must:
26 - Load `.env` from project root using `find_dotenv()`
27 - Fetch data via OpenAlgo `client.history()` (or yfinance for US symbols)
28 - **Normalize data**: convert index to datetime, sort, strip timezone
29 - Compute the indicator using `openalgo.ta`
30 - Create a Plotly chart with `template="plotly_dark"` and `xaxis_type="category"`
31 - **Overlay indicators** (EMA, Bollinger, Supertrend, Ichimoku) go on the candlestick panel
32 - **Subplot indicators** (RSI, MACD, Stochastic, ADX, Volume, OBV) go below in separate panels
33 - Use `make_subplots` for multi-panel layouts
34 - Add horizontal reference lines where appropriate (RSI 30/70, Stochastic 20/80)
35 - Print a plain-language explanation of the current indicator reading
36 - Save chart as HTML: `{symbol}_{indicator}_chart.html`
37 - Show chart with `fig.show()`
386. Never use icons/emojis in code or output
39
40## Indicator Chart Types
41
42### Overlay Indicators (on candlestick panel)
43| Indicator | Chart Type |
44|-----------|-----------|
45| ema, sma, wma, dema, tema, hma | Line overlay |
46| bbands | Fill-between bands + midline |
47| supertrend | Color-coded line (green=up, red=down) |
48| ichimoku | 5 lines + cloud fill |
49| keltner, donchian | Fill-between channels |
50| sar | Dot markers above/below price |
51| ma-envelopes | Upper/lower band lines |
52
53### Subplot Indicators (separate panel below)
54| Indicator | Chart Type |
55|-----------|-----------|
56| rsi | Line + horizontal 30/70 zones |
57| macd | Line + signal + histogram bars |
58| stochastic | K% + D% lines + 20/80 zones |
59| adx | DI+, DI-, ADX lines + 25 threshold |
60| cci | Line + horizontal +100/-100 zones |
61| williams_r | Line + -20/-80 zones |
62| obv | Line (cumulative) |
63| mfi | Line + 20/80 zones |
64| volume | Bar chart (green/red by price direction) |
65| atr | Line (volatility) |
66
67### Multi-Indicator Charts
68If user asks for "multi" or multiple indicators, create a comprehensive multi-panel chart with:
69- Row 1: Candlestick + EMA overlays
70- Row 2: RSI(14)
71- Row 3: MACD(12,26,9)
72- Row 4: Volume bars
73
74## Signal Markers
75
76If the indicator generates clear buy/sell signals (e.g., crossover, supertrend direction change), add triangle markers:
77- Buy: green triangle-up markers
78- Sell: red triangle-down markers
79
80## Data Periods
81
82| Interval | Default Lookback |
83|----------|-----------------|
84| D | 1 year (365 days) |
85| 1h | 6 months (180 days) |
86| 15m, 30m | 3 months (90 days) |
87| 5m | 1 month (30 days) |
88| 1m | 7 days |
89
90## Plain-Language Explanation
91
92After creating the chart, print a brief explanation:
93
94```
95SBIN — RSI(14) Analysis
96Current RSI: 42.3
97Interpretation: Neutral zone (between 30-70). Neither overbought nor oversold.
98Trend: RSI has been declining from 65 over the past 5 bars, suggesting weakening momentum.
99```
100
101## Example Usage
102
103`/indicator-chart ema SBIN NSE D`
104`/indicator-chart rsi RELIANCE NSE D`
105`/indicator-chart macd AAPL YFINANCE D`
106`/indicator-chart supertrend NIFTY NSE_INDEX D`
107`/indicator-chart multi SBIN NSE D`
108`/indicator-chart bbands INFY NSE 1h`