Update README and SKILL.md for get_historical_candles date/time range

Document the new from_date/to_date parameters, supported date formats,
resolution options, and usage examples including intraday time windows.
This commit is contained in:
Achmad
2026-05-17 08:14:10 +00:00
parent 79d1e0e538
commit c48e188b81
2 changed files with 76 additions and 0 deletions
+26
View File
@@ -16,6 +16,32 @@ MCP server that wraps the [tradingview-screener](https://github.com/shner-elmo/T
| `technical_scan` | Screen by technical indicator conditions |
| `fundamental_scan` | Screen by fundamental metrics |
### Historical Candles
| Tool | Description |
|------|-------------|
| `get_historical_candles` | Fetch OHLCV candlestick data with pattern detection |
Supports count-based and date/time range queries:
```python
# Last 30 daily candles
get_historical_candles("NASDAQ:AAPL")
# Specific date range (daily)
get_historical_candles("IDX:BBRI", from_date="2026-05-08", to_date="2026-05-13")
# Intraday — hourly candles for a date range
get_historical_candles("IDX:BBRI", resolution="60", from_date="2026-05-08", to_date="2026-05-13")
# Intraday — 1-minute candles for a specific time window
get_historical_candles("NASDAQ:AAPL", resolution="1", from_date="2026-05-17 14:00", to_date="2026-05-17 14:05")
```
**Resolutions:** `1`, `5`, `15`, `30`, `60`, `240` (minutes), `D` (daily, default), `W` (weekly), `M` (monthly)
**Date formats:** `YYYY-MM-DD`, `YYYY-MM-DD HH:MM`, or `YYYY-MM-DD HH:MM:SS` (all UTC). When only `from_date` is given, `to_date` defaults to now. Date-only `to_date` is inclusive (covers the full day through 23:59:59).
### Utilities
| Tool | Description |
+50
View File
@@ -19,6 +19,7 @@ Indonesian stocks are accessed via `market_type="stocks"` and `market_country="i
| `find_most_active(market_country="indonesia")` | Most active by volume |
| `technical_scan(market_country="indonesia", ...)` | Screen using technical conditions |
| `fundamental_scan(market_country="indonesia", ...)` | Screen using fundamental metrics |
| `get_historical_candles(ticker, resolution, ...)` | Fetch OHLCV candles with pattern detection; supports date/time ranges |
| `check_holidays(mode="upcoming", limit=10)` | Check IDX holidays (SQLite-cached, `refresh=True` to re-fetch) |
| `check_holidays(mode="check", date="2026-05-14")` | Check if a specific date is a holiday |
| `check_holidays(mode="range", start_date="...", end_date="...")` | List holidays in a date range |
@@ -462,6 +463,55 @@ fundamental_scan({
---
## 5. Historical Candle Data
Use `get_historical_candles` to retrieve OHLCV (Open, High, Low, Close, Volume) candlestick data for trend and pattern analysis. The tool also auto-detects common candlestick patterns (Doji, Hammer, Engulfing, etc.) on the latest candle.
### Resolution Options
| Resolution | Value | Use When |
|-----------|-------|----------|
| 1 minute | `"1"` | Intraday scalping / micro windows |
| 5 minutes | `"5"` | Short intraday sessions |
| 15 minutes | `"15"` | Intraday analysis |
| 30 minutes | `"30"` | Half-session analysis |
| 1 hour | `"60"` | Multi-day intraday view |
| 4 hours | `"240"` | Swing trade context |
| Daily | `"D"` | Standard daily chart (default) |
| Weekly | `"W"` | Long-term trend |
| Monthly | `"M"` | Macro view |
### Query Forms
```python
# Last N daily candles (count-based)
get_historical_candles("IDX:BBRI", resolution="D", count=30)
# Specific date range — daily candles
get_historical_candles("IDX:BBRI", from_date="2026-05-08", to_date="2026-05-13")
# Specific date range — hourly candles
get_historical_candles("IDX:BBRI", resolution="60", from_date="2026-05-08", to_date="2026-05-13")
# From a date until now — daily
get_historical_candles("IDX:BBRI", from_date="2026-05-01")
# Intraday time window — 1-minute candles
get_historical_candles("IDX:BBRI", resolution="1", from_date="2026-05-17 09:00", to_date="2026-05-17 12:00")
```
**Date format:** `YYYY-MM-DD` or `YYYY-MM-DD HH:MM` or `YYYY-MM-DD HH:MM:SS` — all interpreted as **UTC**. IDX Session 1 opens at 02:00 UTC (09:00 WIB), Session 2 closes at 08:50 UTC (15:50 WIB).
### When to Use Candle Data
- **Pattern detection**: Doji, Hammer, Shooting Star, Engulfing — confirms entry/exit signals from screener scans
- **Price action around events**: Earnings dates, BI rate decisions, commodity price shocks
- **Holiday gap analysis**: Fetch candles across a multi-day holiday break to measure the gap at reopen
- **Intraday session analysis**: Compare Session 1 vs Session 2 behavior using hourly resolution
- **Trend confirmation**: Check that a breakout screener result is backed by clean candle structure
---
## 6. Pre-Analysis Checklist
Before running any analysis, always perform these 3 preliminary checks: