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
//! # Technical Indicators
//!
//! A comprehensive Rust library for calculating financial technical indicators
//! using the [Polars](https://pola.rs/) DataFrame library.
//!
//! This crate provides functions to calculate various technical indicators
//! from OHLCV (Open, High, Low, Close, Volume) data stored in Polars DataFrames.
//!
//! ## Categories
//!
//! The indicators are organized into the following categories:
//!
//! - **Moving Averages**: Trend-following indicators that smooth price data
//! - **Oscillators**: Indicators that fluctuate within a bounded range
//! - **Volatility**: Indicators that measure the rate of price movement
//! - **Volume**: Indicators based on trading volume
//! - **Momentum**: Indicators that measure the rate of price change
//!
//! ## Usage Examples
//!
//! ### Basic Indicator Calculation
//!
//! ```rust
//! use polars::prelude::*;
//! use ta_lib_in_rust::indicators::moving_averages::calculate_sma;
//!
//! fn main() -> PolarsResult<()> {
//! let close_prices = Series::new(
//! "close".into(),
//! &[
//! 100.0, 101.0, 102.0, 103.0, 105.0, 104.0, 106.0, 107.0, 109.0, 108.0,
//! 107.0, 109.0, 111.0, 114.0, 113.0, 116.0, 119.0, 120.0, 119.0, 117.0,
//! 118.0, 120.0, 123.0, 122.0, 120.0, 118.0, 119.0, 121.0, 124.0, 125.0,
//! ],
//! );
//! // Create a sample DataFrame with price data
//! let mut df = DataFrame::new(vec![close_prices.clone().into()])?;
//!
//! // Calculate a Simple Moving Average
//! let sma_10 = calculate_sma(&df, "close", 10)?;
//! df.with_column(sma_10)?;
//!
//! println!("{}", df);
//! Ok(())
//! }
//! ```
//!
//! ## Advanced Intraday Strategy Example
//!
//! See `examples/enhanced_minute_strategy_example.rs` for a full example of an advanced minute-level multi-indicator strategy. This example demonstrates:
//!
//! - Loading minute-level OHLCV data from CSV
//! - Running a multi-indicator strategy with risk management
//! - Calculating and printing performance metrics
//! - Saving all signals and indicators to a CSV file (`enhanced_minute_strategy_results.csv`) for further analysis
//!
//! See the documentation for each module for more detailed information and examples.
// Re-export commonly used items
pub use *;
// This is a placeholder function - should be removed before final release