" + if prev_date: + html_content += 'Previous Date '.format( + prev_date + ) + if next_date: + html_content += 'Next Date '.format(next_date) + html_content += "
" + # Display the anomalies in a table + html_content += ( + 'Ticker | " + html_content += "Trades | " + html_content += "Avg Trades | " + html_content += "Std Dev | " + html_content += "Z-score | " + html_content += "Close Price | " + html_content += "Price Diff | " + html_content += "Chart | " + html_content += "
---|---|---|---|---|---|---|---|
{} | ".format(anomaly["ticker"]) + html_content += "{} | ".format(anomaly["trades"]) + html_content += "{:.2f} | ".format(anomaly["avg_trades"]) + html_content += "{:.2f} | ".format(anomaly["std_trades"]) + html_content += "{:.2f} | ".format(anomaly["z_score"]) + html_content += "{:.2f} | ".format(anomaly["close_price"]) + html_content += "{:.2f} | ".format(anomaly["price_diff"]) + # Add a link to the chart + html_content += ( + 'View Chart | '.format( + anomaly["ticker"], latest_date + ) + ) + html_content += "