traders_copilot_mzza_25.indicators ================================== .. py:module:: traders_copilot_mzza_25.indicators Functions --------- .. autoapisummary:: traders_copilot_mzza_25.indicators.calculate_sma traders_copilot_mzza_25.indicators.calculate_rsi Module Contents --------------- .. py:function:: calculate_sma(data, window=50, fillna=False) Calculate the Simple Moving Average (SMA) for the given data. :param data: DataFrame containing stock price data with a 'Close' column. :type data: pandas.DataFrame :param window: The number of periods to calculate the SMA (default is 50). :type window: int, optional :param fillna: Whether to fill NaN values (default is False). :type fillna: bool, optional :returns: DataFrame with an additional column for the SMA. :rtype: pandas.DataFrame .. rubric:: Examples >>> data = pd.DataFrame({'Close': [100, 102, 104, 106, 108]}) >>> result = calculate_sma(data, window=3) >>> print(result['SMA_3']) .. py:function:: calculate_rsi(data, window=14, fillna=False) Calculate the Relative Strength Index (RSI) measuring the speed and change of price movements. :param data: DataFrame containing stock price data with a 'Close' column. :type data: pandas.DataFrame :param window: Number of periods for RSI calculation (default is 14). :type window: int, optional :param fillna: Whether to fill NaN values (default is False). :type fillna: bool, optional :returns: DataFrame with an additional column for RSI. :rtype: pandas.DataFrame .. rubric:: Examples >>> data = pd.DataFrame({'Close': [100, 102, 104, 106, 108]}) >>> result = calculate_rsi(data, window=3) >>> print(result['RSI'])