kevinhug commited on
Commit
24b7694
·
1 Parent(s): 9291158
Files changed (2) hide show
  1. app.py +31 -1
  2. requirements.txt +4 -1
app.py CHANGED
@@ -7,6 +7,29 @@ https://huggingface.co/spaces/kevinhug/clientX
7
  https://hits.seeyoufarm.com/
8
  '''
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  '''
11
  SIMILAR VECTOR DB SEARCH
12
  '''
@@ -183,7 +206,14 @@ Use Case:
183
  - intervene attrition through incentive
184
 
185
  """)
186
-
 
 
 
 
 
 
 
187
 
188
  demo.launch()
189
 
 
7
  https://hits.seeyoufarm.com/
8
  '''
9
 
10
+ '''
11
+ TIME SERIES ANALYTICS
12
+ '''
13
+ import yfinance as yf
14
+ import seaborn as sns
15
+
16
+ def trend(t):
17
+ data = yf.download(t, period="3mo")
18
+
19
+ for c in t.split(' '):
20
+ q=data.loc[:,('Close',c)]
21
+ data.loc[:,('Close_MA',c)]=q.rolling(9).mean() -q.rolling(42).mean()
22
+ q=data.loc[:,('Volume',c)]
23
+ data.loc[:,('Volume_MA',c)]=q.rolling(9).mean() -q.rolling(42).mean()
24
+
25
+ ma=data.loc[:,["Volume_MA","Close_MA"]].tail(15)
26
+ from sklearn.preprocessing import StandardScaler
27
+ std=StandardScaler()
28
+ result=std.fit_transform(ma)
29
+ df=pd.DataFrame(result,columns=ma.columns)
30
+ d=df.tail(1).stack(level=-1).droplevel(0, axis=0)
31
+ return sns.scatterplot(d, x="Close_MA", y="Volume_MA",hue=d.index.values)
32
+
33
  '''
34
  SIMILAR VECTOR DB SEARCH
35
  '''
 
206
  - intervene attrition through incentive
207
 
208
  """)
209
+ with gr.Tab("Trading Analyics"):
210
+ in_ts = gr.Textbox(placeholder="QQQM CIF VEGI PJP",
211
+ label="Ticker",
212
+ info="Identify Industry Trend, (top right is grow trending)"
213
+ )
214
+ plot = gr.Plot(label="Identify Trend/Decline Industry")
215
+ btn_ts = gr.Button("Find Trending Industry")
216
+ btn_ts.click(fn=trend, inputs=in_ts, outputs=[plot])
217
 
218
  demo.launch()
219
 
requirements.txt CHANGED
@@ -1,2 +1,5 @@
1
  chromadb
2
- fastai
 
 
 
 
1
  chromadb
2
+ fastai
3
+ yfinance
4
+ scikit-learn
5
+ seaborn