pub struct Candle {
pub date: DateTime<Utc>,
pub open: f64,
pub high: f64,
pub low: f64,
pub close: f64,
pub volume: u64,
pub oi: Option<u64>,
}Expand description
Historical candle data point
Represents a single OHLCV (Open, High, Low, Close, Volume) data point for a specific time period. Each candle contains price and volume information for the specified interval.
§Data Quality
- Prices are adjusted for corporate actions (splits, bonuses, dividends)
- Volume is in number of shares/contracts traded
- Open interest (if available) is the total outstanding contracts
§Example
use kiteconnect_async_wasm::models::market_data::Candle;
use chrono::{DateTime, Utc};
println!("Date: {}", candle.date.format("%Y-%m-%d %H:%M:%S"));
println!("OHLC: {}/{}/{}/{}", candle.open, candle.high, candle.low, candle.close);
println!("Volume: {}", candle.volume);
if let Some(oi) = candle.oi {
println!("Open Interest: {}", oi);
}
// Calculate price change
let change = candle.close - candle.open;
let change_pct = (change / candle.open) * 100.0;
println!("Change: ₹{:.2} ({:.2}%)", change, change_pct);Fields§
§date: DateTime<Utc>Timestamp in UTC
The date and time for this candle in UTC. For daily candles, this typically represents the market close time. For intraday candles, it represents the end time of the interval.
Note: Even though stored as UTC, the original data is based on IST.
open: f64Opening price for the interval
The first traded price during this time interval. For daily candles, this is the opening price of the trading day.
high: f64Highest price during the interval
The maximum price reached during this time interval.
low: f64Lowest price during the interval
The minimum price reached during this time interval.
close: f64Closing price for the interval
The last traded price during this time interval. For daily candles, this is the closing price of the trading day.
volume: u64Volume traded during the interval
Total number of shares/contracts traded during this time interval. Higher volume often indicates stronger price moves and better liquidity.
oi: Option<u64>Open interest (for derivatives only)
The total number of outstanding contracts at the end of this interval.
Only available for futures and options. None for equity instruments.
Open interest helps gauge market sentiment:
- Increasing OI + Rising prices = Bullish sentiment
- Increasing OI + Falling prices = Bearish sentiment
- Decreasing OI = Position unwinding