AmirTrader commited on
Commit
abc9047
·
1 Parent(s): 5e124b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -31,16 +31,14 @@ def getPolygonDF(ticker , startdate , enddate , intervalperiod, window, window2)
31
  df['UNIXTIME'] = pd.to_datetime(df['t'], unit='ms', utc=True).map(lambda x: x.tz_convert('America/New_York'))
32
  dflst.append(df)
33
  print(df.shape)
34
- time.sleep(15)
35
  try:
36
  nexturl = json.loads(r1.text)["next_url"]
37
  except:
38
  break
39
  DF = pd.concat(dflst)
40
- DF['SMA'] = DF.Close.rolling(window=window).mean()
41
- DF['SMA2'] = DF.Close.rolling(window=window2).mean()
42
- DF = DF.reset_index()
43
- print(DF)
44
  return DF
45
 
46
  def get_hvplot(ticker , startdate , enddate , interval,window,window2):
@@ -96,6 +94,6 @@ pn.Row(
96
  # pn.bind(calc_fairprice_CDF,ticker),
97
  # pn.bind(calc_fairprice_DnetP,ticker)),
98
  # pn.panel(pn.bind(get_hvplot, ticker, "2010-01-01","2023-09-01","1d")) #, sizing_mode='stretch_width')
99
- # pn.panel(pn.bind(get_hvplot, ticker, date_start , date_end,"5",window,window2)), #, sizing_mode='stretch_width')
100
  # pn.panel(pn.bind(get_income_hvplot, ticker)) #, sizing_mode='stretch_width')
101
  ).servable(title="Intraday Price Action - Pattern Detection")
 
31
  df['UNIXTIME'] = pd.to_datetime(df['t'], unit='ms', utc=True).map(lambda x: x.tz_convert('America/New_York'))
32
  dflst.append(df)
33
  print(df.shape)
34
+ # time.sleep(15)
35
  try:
36
  nexturl = json.loads(r1.text)["next_url"]
37
  except:
38
  break
39
  DF = pd.concat(dflst)
40
+ DF['SMA'] = DF.c.rolling(window=window).mean()
41
+ DF['SMA2'] = DF.c.rolling(window=window2).mean()
 
 
42
  return DF
43
 
44
  def get_hvplot(ticker , startdate , enddate , interval,window,window2):
 
94
  # pn.bind(calc_fairprice_CDF,ticker),
95
  # pn.bind(calc_fairprice_DnetP,ticker)),
96
  # pn.panel(pn.bind(get_hvplot, ticker, "2010-01-01","2023-09-01","1d")) #, sizing_mode='stretch_width')
97
+ pn.panel(pn.bind(get_hvplot, ticker, date_start , date_end,"5",window,window2)), #, sizing_mode='stretch_width')
98
  # pn.panel(pn.bind(get_income_hvplot, ticker)) #, sizing_mode='stretch_width')
99
  ).servable(title="Intraday Price Action - Pattern Detection")