AmirTrader commited on
Commit
a667e70
·
verified ·
1 Parent(s): 63566b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py CHANGED
@@ -602,6 +602,32 @@ if st.sidebar.button("Option Chain Visualization", use_container_width=True):
602
  )
603
  st.plotly_chart(fig_bar7, use_container_width=True)
604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  st.markdown("---") # Add a horizontal line as a visual separator
606
  # Support and Resistance Levels on Price Chart
607
  # Description: Overlay horizontal lines on the underlying asset's price chart at strike prices with significant open interest.
 
602
  )
603
  st.plotly_chart(fig_bar7, use_container_width=True)
604
 
605
+ st.markdown("---") # Add a horizontal line as a visual separator
606
+ # Price vs. Strike Scatter Plot with OI Sizing
607
+ # Description: Scatter plot where each point represents an option contract, with the x-axis as strike price, y-axis as option price, and point size proportional to open interest.
608
+ # Purpose: Visualizes the relationship between option pricing and open interest across strikes.
609
+ # Implementation: Use strike for the x-axis and lastPrice for the y-axis. Set the size of each point based on openInterest. Differentiate calls and puts using color or markers
610
+ st.write(
611
+ "*Tips: in Price vs. Strike Scatter Plot with Days Left Sizing, Larger points indicate higher open interest, helping to identify popular strike prices.*"
612
+ )
613
+ fig_bar7_2 = px.scatter(
614
+ filtered_ticker_df,
615
+ x="strike",
616
+ y="lastPrice",
617
+ size="daysleft",
618
+ color="Type",
619
+ title=f"Price vs. Strike Scatter Plot for {selectedTicker}",
620
+ labels={"x": "Strike Price", "y": "Option Price"},
621
+ color_discrete_map={"CALL": "green", "PUT": "red"},
622
+ )
623
+ fig_bar7_2.update_layout(
624
+ xaxis_title="Strike Price",
625
+ yaxis_title="Option Price",
626
+ autosize=True,
627
+ height=600,
628
+ )
629
+ st.plotly_chart(fig_bar7_2, use_container_width=True)
630
+
631
  st.markdown("---") # Add a horizontal line as a visual separator
632
  # Support and Resistance Levels on Price Chart
633
  # Description: Overlay horizontal lines on the underlying asset's price chart at strike prices with significant open interest.