SYMBOL INDEX (159 symbols across 18 files) FILE: TrendFollowingStrategy/config.py function get_config (line 113) | def get_config(section: str = None) -> Dict[str, Any]: function get_instrument_config (line 126) | def get_instrument_config(symbol: str) -> Dict[str, Any]: function validate_config (line 137) | def validate_config() -> bool: function get_paths (line 159) | def get_paths() -> Dict[str, str]: function ensure_directories (line 162) | def ensure_directories() -> None: function add_sys_path (line 166) | def add_sys_path() -> None: FILE: TrendFollowingStrategy/scripts/main_simple.py class MA20TrendFollowingStrategySimple (line 34) | class MA20TrendFollowingStrategySimple: method __init__ (line 37) | def __init__(self, symbol: str = 'RB0', data_source: str = 'akshare'): method create_test_data (line 57) | def create_test_data(self, start_date: str, end_date: str) -> pd.DataF... method prepare_data (line 101) | def prepare_data(self, start_date: str, end_date: str, method simple_backtest (line 162) | def simple_backtest(self, data: pd.DataFrame, initial_capital: float =... method run_complete_strategy (line 392) | def run_complete_strategy(self, start_date: str = '2020-01-01', method generate_performance_report (line 440) | def generate_performance_report(self, backtest_results: Dict[str, Any]... method _save_complete_results (line 491) | def _save_complete_results(self, results: Dict[str, Any]): function main (line 537) | def main(): FILE: TrendFollowingStrategy/scripts/multibacktest.py class MultiInstrumentBacktest (line 28) | class MultiInstrumentBacktest: method __init__ (line 31) | def __init__(self): method test_single_instrument (line 37) | def test_single_instrument(self, symbol: str, start_date: str = '2020-... method test_multiple_instruments (line 72) | def test_multiple_instruments(self, symbols: List[str], method compare_results (line 113) | def compare_results(self) -> pd.DataFrame: method generate_comparison_report (line 173) | def generate_comparison_report(self) -> str: method save_comparison_results (line 238) | def save_comparison_results(self, save_dir: str = None): method sensitivity_analysis (line 275) | def sensitivity_analysis(self, symbol: str = 'RB0', function run_comprehensive_multibacktest (line 362) | def run_comprehensive_multibacktest(): FILE: TrendFollowingStrategy/scripts/simple_backtest.py function create_test_data (line 23) | def create_test_data(): function simple_backtest (line 54) | def simple_backtest(data, initial_capital=100000, ma_period=20, commissi... function main (line 266) | def main(): FILE: TrendFollowingStrategy/scripts/simple_test.py function test_basic_functionality (line 11) | def test_basic_functionality(): function test_data_validation (line 96) | def test_data_validation(): function test_signal_logic (line 133) | def test_signal_logic(): FILE: TrendFollowingStrategy/scripts/simple_visualization.py function create_simple_visualization (line 32) | def create_simple_visualization(): function show_sample_charts (line 268) | def show_sample_charts(): FILE: TrendFollowingStrategy/scripts/view_charts.py function show_visualization_report (line 21) | def show_visualization_report(): function create_html_report (line 102) | def create_html_report(): FILE: TrendFollowingStrategy/scripts/view_charts_simple.py function show_charts (line 21) | def show_charts(): function create_simple_html_viewer (line 117) | def create_simple_html_viewer(): FILE: TrendFollowingStrategy/src/backtest_engine.py class MA20Strategy (line 18) | class MA20Strategy(bt.Strategy): method __init__ (line 32) | def __init__(self): method next (line 49) | def next(self): method _check_entry_conditions (line 59) | def _check_entry_conditions(self): method _enter_long_position (line 72) | def _enter_long_position(self): method _enter_short_position (line 97) | def _enter_short_position(self): method _check_exit_conditions (line 122) | def _check_exit_conditions(self): method notify_order (line 142) | def notify_order(self, order): method notify_trade (line 146) | def notify_trade(self, trade): method log (line 157) | def log(self, txt, dt=None): method stop (line 162) | def stop(self): class BacktestEngine (line 166) | class BacktestEngine: method __init__ (line 167) | def __init__(self, symbol: str = 'RB0'): method prepare_data (line 175) | def prepare_data(self, df: pd.DataFrame) -> bt.feeds.PandasData: method setup_cerebro (line 186) | def setup_cerebro(self, df: pd.DataFrame, initial_capital: float = 100... method _add_analyzers (line 208) | def _add_analyzers(self): method run_backtest (line 216) | def run_backtest(self, df: pd.DataFrame, initial_capital: float = 1000... method _extract_results (line 221) | def _extract_results(self) -> Dict[str, Any]: method print_backtest_report (line 272) | def print_backtest_report(self, results: Dict[str, Any]): FILE: TrendFollowingStrategy/src/data_fetcher.py class DataFetcher (line 36) | class DataFetcher: method __init__ (line 39) | def __init__(self, data_source: str = 'tushare'): method fetch_futures_data (line 60) | def fetch_futures_data(self, symbol: str, start_date: str, end_date: s... method _fetch_from_tushare (line 71) | def _fetch_from_tushare(self, symbol: str, start_date: str, end_date: ... method _fetch_from_akshare (line 109) | def _fetch_from_akshare(self, symbol: str, start_date: str, end_date: ... method _process_tushare_data (line 131) | def _process_tushare_data(self, df: pd.DataFrame) -> pd.DataFrame: method _process_akshare_data (line 153) | def _process_akshare_data(self, df: pd.DataFrame) -> pd.DataFrame: method _validate_price_data (line 176) | def _validate_price_data(self, df: pd.DataFrame) -> None: method save_data (line 196) | def save_data(self, df: pd.DataFrame, symbol: str, data_dir: Optional[... method load_cached_data (line 212) | def load_cached_data(self, filepath: str) -> Optional[pd.DataFrame]: function test_data_fetcher (line 222) | def test_data_fetcher(): FILE: TrendFollowingStrategy/src/data_processor.py class DataProcessor (line 16) | class DataProcessor: method __init__ (line 19) | def __init__(self): method create_2day_kline (line 24) | def create_2day_kline(self, df: pd.DataFrame) -> pd.DataFrame: method calculate_ma (line 77) | def calculate_ma(self, df: pd.DataFrame, period: int = 20, price_col: ... method calculate_kline_features (line 100) | def calculate_kline_features(self, df: pd.DataFrame) -> pd.DataFrame: method calculate_price_position (line 128) | def calculate_price_position(self, df: pd.DataFrame, ma_period: int = ... method prepare_strategy_data (line 154) | def prepare_strategy_data(self, df: pd.DataFrame, ma_period: int = 20)... method _validate_resampled_data (line 181) | def _validate_resampled_data(self, original_df: pd.DataFrame, resample... method get_data_summary (line 223) | def get_data_summary(self, df: pd.DataFrame) -> Dict[str, Any]: function test_data_processor (line 264) | def test_data_processor(): FILE: TrendFollowingStrategy/src/performance_analyzer.py class PerformanceAnalyzer (line 39) | class PerformanceAnalyzer: method __init__ (line 42) | def __init__(self): method calculate_metrics (line 47) | def calculate_metrics(self, trades_df: pd.DataFrame, equity_curve: pd.... method _calculate_consecutive_trades (line 161) | def _calculate_consecutive_trades(self, trades_df: pd.DataFrame, trade... method _calculate_drawdown (line 205) | def _calculate_drawdown(self, equity_curve: pd.Series) -> Dict[str, Any]: method analyze_monthly_returns (line 241) | def analyze_monthly_returns(self, trades_df: pd.DataFrame) -> pd.DataF... method generate_performance_report (line 280) | def generate_performance_report(self, trades_df: pd.DataFrame, class PerformanceVisualizer (line 358) | class PerformanceVisualizer: method __init__ (line 361) | def __init__(self): method plot_equity_curve (line 366) | def plot_equity_curve(self, equity_curve: pd.Series, benchmark: Option... method drawdown_chart (line 414) | def drawdown_chart(self, equity_curve: pd.Series, save_path: Optional[... method trade_distribution (line 467) | def trade_distribution(self, trades_df: pd.DataFrame, save_path: Optio... method monthly_performance_heatmap (line 530) | def monthly_performance_heatmap(self, trades_df: pd.DataFrame, save_pa... function test_performance_analyzer (line 571) | def test_performance_analyzer(): FILE: TrendFollowingStrategy/src/risk_manager.py class PositionSide (line 17) | class PositionSide(Enum): class RiskParameters (line 25) | class RiskParameters: class StopLossResult (line 35) | class StopLossResult: class PositionSizeResult (line 45) | class PositionSizeResult: class RiskManager (line 54) | class RiskManager: method __init__ (line 57) | def __init__(self, parameters: Optional[RiskParameters] = None): method calculate_stop_loss (line 65) | def calculate_stop_loss(self, entry_price: float, prev_extreme: float, method calculate_position_size (line 150) | def calculate_position_size(self, capital: float, entry_price: float, method calculate_trailing_stop (line 211) | def calculate_trailing_stop(self, entry_price: float, current_price: f... method validate_risk_parameters (line 241) | def validate_risk_parameters(self) -> Dict[str, Any]: method get_risk_summary (line 276) | def get_risk_summary(self, trades_df: pd.DataFrame) -> Dict[str, Any]: function test_risk_manager (line 329) | def test_risk_manager(): FILE: TrendFollowingStrategy/src/signal_generator.py class SignalType (line 17) | class SignalType(Enum): class TradingSignal (line 26) | class TradingSignal: class SignalGenerator (line 36) | class SignalGenerator: method __init__ (line 39) | def __init__(self, ma_period: int = 20): method generate_signals (line 48) | def generate_signals(self, df: pd.DataFrame) -> pd.DataFrame: method generate_signal_at_index (line 110) | def generate_signal_at_index(self, df: pd.DataFrame, index: int) -> Op... method add_signal_filters (line 152) | def add_signal_filters(self, df: pd.DataFrame, method get_signal_statistics (line 197) | def get_signal_statistics(self, df: pd.DataFrame) -> Dict[str, Any]: method plot_signal_distribution (line 237) | def plot_signal_distribution(self, df: pd.DataFrame, save_path: Option... function test_signal_generator (line 325) | def test_signal_generator(): FILE: TrendFollowingStrategy/src/visualization.py class StrategyVisualizer (line 23) | class StrategyVisualizer: method __init__ (line 24) | def __init__(self, figsize=(15, 10)): method create_comprehensive_report (line 35) | def create_comprehensive_report(self, data: pd.DataFrame, trades: pd.D... method plot_equity_curve (line 53) | def plot_equity_curve(self, data: pd.DataFrame, trades: pd.DataFrame, ... method plot_price_chart_with_signals (line 67) | def plot_price_chart_with_signals(self, data: pd.DataFrame, trades: pd... method plot_trade_distribution (line 85) | def plot_trade_distribution(self, trades: pd.DataFrame, save_dir: str,... method plot_monthly_performance (line 107) | def plot_monthly_performance(self, trades: pd.DataFrame, save_dir: str... method plot_drawdown_analysis (line 121) | def plot_drawdown_analysis(self, data: pd.DataFrame, trades: pd.DataFr... method plot_trade_timing_analysis (line 137) | def plot_trade_timing_analysis(self, trades: pd.DataFrame, save_dir: s... method _calculate_equity_curve (line 162) | def _calculate_equity_curve(self, trades: pd.DataFrame, initial_capita... method _calculate_drawdown (line 171) | def _calculate_drawdown(self, equity_curve: pd.Series) -> pd.Series: method _calculate_recovery_times (line 176) | def _calculate_recovery_times(self, equity_curve: pd.Series, drawdown:... method generate_html_dashboard (line 185) | def generate_html_dashboard(self, save_dir: str, timestamp: str): function create_visualization_from_backtest_results (line 200) | def create_visualization_from_backtest_results(): FILE: TrendFollowingStrategy/tests/test_backtest.py function test_backtest_engine (line 20) | def test_backtest_engine(): function test_backtest_engine (line 51) | def test_backtest_engine(): function test_risk_management (line 122) | def test_risk_management(): FILE: TrendFollowingStrategy/tests/test_simple.py function create_test_data (line 20) | def create_test_data(): function test_core_modules (line 51) | def test_core_modules(): FILE: TrendFollowingStrategy/tests/test_strategy.py class TestDataFetcher (line 31) | class TestDataFetcher(unittest.TestCase): method setUp (line 34) | def setUp(self): method test_fetch_futures_data (line 38) | def test_fetch_futures_data(self): method test_data_validation (line 62) | def test_data_validation(self): class TestDataProcessor (line 85) | class TestDataProcessor(unittest.TestCase): method setUp (line 88) | def setUp(self): method test_create_2day_kline (line 103) | def test_create_2day_kline(self): method test_calculate_ma (line 133) | def test_calculate_ma(self): method test_kline_features (line 154) | def test_kline_features(self): class TestSignalGenerator (line 175) | class TestSignalGenerator(unittest.TestCase): method setUp (line 178) | def setUp(self): method test_generate_signals (line 195) | def test_generate_signals(self): method test_signal_at_index (line 223) | def test_signal_at_index(self): class TestRiskManager (line 240) | class TestRiskManager(unittest.TestCase): method setUp (line 243) | def setUp(self): method test_calculate_stop_loss_long (line 247) | def test_calculate_stop_loss_long(self): method test_calculate_stop_loss_short (line 264) | def test_calculate_stop_loss_short(self): method test_force_stop_calculation (line 281) | def test_force_stop_calculation(self): method test_position_size_calculation (line 296) | def test_position_size_calculation(self): method test_risk_parameter_validation (line 315) | def test_risk_parameter_validation(self): class TestConfig (line 330) | class TestConfig(unittest.TestCase): method test_config_loading (line 333) | def test_config_loading(self): method test_instrument_config (line 348) | def test_instrument_config(self): method test_config_validation (line 359) | def test_config_validation(self): class TestIntegration (line 367) | class TestIntegration(unittest.TestCase): method setUp (line 370) | def setUp(self): method test_complete_workflow (line 399) | def test_complete_workflow(self): function run_comprehensive_tests (line 429) | def run_comprehensive_tests():