get_moving_averages
Calculate Simple and Exponential Moving Averages for a stock over multiple periods and a date range. Auto-prefetches warmup data to ensure non-null values within the range.
Instructions
Calculate SMA and EMA for multiple periods over the requested date range.
Returns one row per trading day in [start_date, end_date]. Warmup is auto-prefetched, so values inside the range are not null from warmup. A period exceeding the stock's available history yields present-but-all-null SMA_/EMA_ columns, so a requested period never silently vanishes.
Args: code: Stock code. start_date: 'YYYY-MM-DD'. end_date: 'YYYY-MM-DD'. periods: Period list (each must be >= 1), e.g. [5,10,20,50,120,250]. Defaults to common set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| start_date | Yes | ||
| end_date | Yes | ||
| periods | No |