traders_copilot_mzza_25.plot_signals ==================================== .. py:module:: traders_copilot_mzza_25.plot_signals Functions --------- .. autoapisummary:: traders_copilot_mzza_25.plot_signals.validate_columns traders_copilot_mzza_25.plot_signals.validate_lengths traders_copilot_mzza_25.plot_signals.validate_non_empty traders_copilot_mzza_25.plot_signals.validate_dates traders_copilot_mzza_25.plot_signals.generate_plot traders_copilot_mzza_25.plot_signals.plot_signals Module Contents --------------- .. py:function:: validate_columns(data, price_col, time_col) Ensure the DataFrame contains the specified price and time columns. .. py:function:: validate_lengths(data, price_col, time_col) Ensure the lengths of the price and time columns match. .. py:function:: validate_non_empty(data, price_col, time_col) Ensure both price and time columns are non-empty. .. py:function:: validate_dates(data, time_col) Validate that each date in the time column is in the 'YYYY-MM-DD' format. .. py:function:: generate_plot(price, time) Generate a Matplotlib figure for the price vs. time data. .. py:function:: plot_signals(data, price_col='Close', time_col='Date') Plot a time series depicting the price at specific timestamps from a DataFrame. :param data: The input DataFrame containing price and time data. :type data: pandas.DataFrame :param price_col: The column name for price data (default is "Close"). :type price_col: str, optional :param time_col: The column name for time data (default is "Date"). :type time_col: str, optional :returns: The Matplotlib figure object containing the time series plot. :rtype: matplotlib.figure.Figure :raises ValueError: If the DataFrame does not contain the specified columns. If the lengths of the columns do not match. If the columns are empty. If any date in the time column is not in the 'YYYY-MM-DD' format. .. rubric:: Examples >>> data = pd.DataFrame({"Date": ["2023-01-01", "2023-01-02", "2023-01-03"], >>> "Close": [100, 102, 104]}) >>> fig = plot_signals(data) >>> fig.show()