> For the complete documentation index, see [llms.txt](https://docs.sov.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sov.ai/api-reference/plots-1/news-plots.md).

# News Plots

**Module:** `sovai.plots.news.news_plots`

## Functions

### `create_plot_news_sent_price()`

```python
def create_plot_news_sent_price(ticker, variable, df_price, df_news)
```

***

### `plot_above_sentiment_returns()`

```python
def plot_above_sentiment_returns(df_news = None, tickers = None)
```

***

### `fetch_and_prepare_data()`

```python
def fetch_and_prepare_data(ticker, variables)
```

***

### `calculate_sharpe_ratio()`

```python
def calculate_sharpe_ratio(returns, risk_free_rate = 0.02)
```

***

### `calculate_max_drawdown()`

```python
def calculate_max_drawdown(returns)
```

***

### `calculate_strategy_performance()`

```python
def calculate_strategy_performance(
    df,
    column,
    long_ma,
    short_ma,
    threshold,
    future_days,
    transaction_cost = 0.001,
)
```

***

### `calculate_accuracy()`

```python
def calculate_accuracy(df, column, long_ma, short_ma, threshold, future_days)
```

***

### `optimize_parameters()`

```python
def optimize_parameters(df, column)
```

***

### `create_plot()`

```python
def create_plot(df, ticker, column, long_ma, short_ma, threshold, future_days)
```

***

### `plot_news_daily()`

```python
def plot_news_daily(ticker = 'NVDA')
```

***

### `dash_news_ts_analysis()`

```python
def dash_news_ts_analysis(df_sentiment, df_polarity, df_topic)
```

***
