File size: 692 Bytes
d9f8113
 
7a66c3c
d9f8113
 
 
 
 
 
 
 
 
 
 
3a949cf
 
d9f8113
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
import yfinance as yf
from tradingpatterns import tradingpatterns  # Adjust import based on your package structure

def main():
    st.title("Trading Pattern Detection App")

    # Sidebar for user input
    stock_symbol = st.sidebar.text_input("Enter Stock Symbol", value='AAPL')
    period = st.sidebar.selectbox("Select Period", ['1d', '1mo', '3mo', '6mo', '1y'])

    # Download latest available data using yfinance
    data = yf.download(stock_symbol, period=period)

    # Use tradingpatterns module
    result = tradingpatterns.detect_patterns(data)

    # Display the result
    st.write("## Result:")
    st.write(result)

if __name__ == "__main__":
    main()