# 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)
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sov.ai/api-reference/plots-1/news-plots.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
