1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//! # Day Trading Indicators
//!
//! This module provides indicators optimized for intraday trading and
//! short-term price movements within a single trading day.
//!
//! ## Types of Indicators
//!
//! - Intraday momentum indicators with faster response times
//! - Volume-price relationship indicators for short timeframes
//! - Market microstructure indicators for order flow analysis
//! - Volatility indicators calibrated for intraday movements
use *;
/// Calculate intraday momentum oscillator
///
/// A faster-responding version of RSI optimized for intraday trading.
///
/// # Arguments
///
/// * `df` - DataFrame with price data (typically minute or tick data)
/// * `period` - Calculation period (typically 7-14 periods for intraday)
///
/// # Returns
///
/// * `Result<Series, PolarsError>` - Series with oscillator values
/// Calculate order flow imbalance
///
/// Measures the imbalance between buying and selling pressure
/// based on tick-by-tick data and trade direction.
///
/// # Arguments
///
/// * `df` - DataFrame with tick data including trade direction
/// * `volume_weighted` - Whether to weight the imbalance by volume
///
/// # Returns
///
/// * `Result<Series, PolarsError>` - Series with imbalance values
/// Detect intraday breakout patterns
///
/// Identifies potential intraday breakout patterns based on
/// price action and volume confirmation.
///
/// # Arguments
///
/// * `df` - DataFrame with price and volume data
/// * `consolidation_periods` - Minimum periods of consolidation before breakout
/// * `volume_threshold` - Volume increase threshold for confirmation
///
/// # Returns
///
/// * `Result<Series, PolarsError>` - Series with breakout signals
/// Calculate price velocities at different timeframes
///
/// Calculates the rate of price change at different intraday timeframes
/// to identify short-term momentum.
///
/// # Arguments
///
/// * `df` - DataFrame with price data
/// * `periods` - Vector of different timeframes to calculate velocity
///
/// # Returns
///
/// * `Result<Vec<Series>, PolarsError>` - Vector of Series with velocities at different timeframes
/// Calculate intraday price levels based on pivot points
///
/// # Arguments
///
/// * `df` - DataFrame with OHLC data
/// * `period` - Lookback period for pivot calculation
/// Calculate VWAP and standard deviation bands
///
/// # Arguments
///
/// * `df` - DataFrame with OHLCV data
/// * `volume_weighted` - Whether to use volume weighting for bands
/// Identify breakout areas in intraday charts
///
/// # Arguments
///
/// * `df` - DataFrame with OHLCV data
/// * `consolidation_periods` - Number of periods to identify consolidation
/// * `volume_threshold` - Volume threshold to confirm a breakout