//  [python]
def generate_chart(df, title, buy_signal_column, sell_signal_column, score_column, thresholds: list):
    """
    All columns in one input df with desired length and desired freq
    Visualize columns 1 (pre-defined): high, low, close
    Visualize columns 1 (via parameters): buy_signal_column, sell_signal_column
    Visualize columns 2: score_column (optional) - in [-1, +1]
    Visualize columns 2: Threshold lines (as many as there are values in the list)
    """
    from matplotlib import pyplot as plt
    import matplotlib.dates as mdates
    import seaborn as sns

    # List of colors: https://matplotlib.org/stable/gallery/color/named_colors.html
    sns.set_style('white')  # darkgrid, whitegrid, dark, white, ticks
    #sns.color_palette("rocket")
    #sns.set(rc={'axes.facecolor': 'gold', 'figure.facecolor': 'white'})
    #sns.set(rc={'figure.facecolor': 'gold'})

    fig, ax1 = plt.subplots(figsize=(12, 6))
    # plt.tight_layout()

    # === High, Low, Close

    # Fill area between high and low
    plt.fill_between(df.timestamp, df.low, df.high, step="mid", lw=0.0, facecolor='skyblue', alpha=.4)  # edgecolor='red',

    # Draw close price
    plt.plot(df.timestamp, df["close"], drawstyle='steps-mid', lw=.5, color='darkblue', ax=ax1)

    # Buy/sell markters (list of timestamps)
    # buy_df = df[df.buy_transaction]
    # sell_df = df[df.sell_transaction]

    # === Transactions

    triangle_adj = 15
    df["close_buy_adj"] = df["close"] - triangle_adj
    df["close_sell_adj"] = df["close"] + triangle_adj

    # markersize=6, markerfacecolor='blue'
    plt.plot(df[df[buy_signal_column] == True].timestamp, df[df[buy_signal_column] == True].close_buy_adj, lw=0, markerfacecolor="green", markersize=10, marker="^", alpha=0.6, ax=ax1)
    plt.plot(df[df[sell_signal_column] == True].timestamp, df[df[sell_signal_column] == True].close_sell_adj, lw=0, markerfacecolor="red", markersize=10, marker="v", alpha=0.6, ax=ax1)

    # g2.set(yticklabels=[])
    # g2.set(title='Penguins: Body Mass by Species for Gender')
    ax1.set(xlabel=None)  # remove the x-axis label
    # g2.set(ylabel=None)  # remove the y-axis label
    ax1.set_ylabel('Close price', color='darkblue')
    # g2.tick_params(left=False)  # remove the ticks
    ymin = df['low'].min()
    ymax = df['high'].max()
    ax1.set(ylim=(ymin - (ymax - ymin) * 0.05, ymax + (ymax - ymin) * 0.005))

    ax1.xaxis.set_major_locator(mdates.DayLocator())
    ax1.xaxis.set_major_formatter(mdates.DateFormatter("%d"))  # "%H:%M:%S" "%d %b"
    ax1.tick_params(axis="x", rotation=0)
    #ax1.xaxis.grid(True)

    # === Score

    if score_column and score_column in df.columns:
        ax2 = ax1.twinx()
        # ax2.plot(x, y1, 'o-', color="red" )
        plt.plot(df.timestamp, df[score_column], drawstyle='steps-mid', lw=.2, color="red", ax=ax2)  # marker="v" "^" , markersize=12
        ax2.set_ylabel('Score', color='r')
        ax2.set_ylabel('Score', color='b')

        ymax = max(df[score_column].abs().max(), max(thresholds) if thresholds else 0.0)
        ax2.set(ylim=(-ymax*2.0, +ymax*2.0))

        ax2.axhline(0.0, lw=.1, color="black")

        for threshold in thresholds:
            ax2.axhline(threshold, lw=.1, color="red")
            ax2.axhline(threshold, lw=.1, color="red")

    # fig.suptitle("My figtitle", fontsize=14)  # Positioned higher
    # plt.title('Weekly: $\\bf{S&P 500}$', fontsize=16)  # , weight='bold' or MathText
    plt.title(title, fontsize=14)
    # ax1.set_title('My Title')

    # plt.show()

    return fig