camphong24032002 commited on
Commit
41875de
·
1 Parent(s): fcc079b

change: set the number of macd storage date from 5 to 20

Browse files
Files changed (1) hide show
  1. services/indicator.py +2 -2
services/indicator.py CHANGED
@@ -349,10 +349,10 @@ class Indicator:
349
  for symbol in lst_symbols:
350
  cnt += 1
351
  url = PREFIX + INDICATORS["MACD"] \
352
- + f"?stockSymbol={symbol}&rangeSelector=3&fastPeriod=12&slowPeriod=26&signalPeriod=9"
353
  data = requests.get(url).json()
354
  rsi_df = pd.DataFrame(
355
- data["SeriesColection"][0]["Points"]).tail(5)
356
  if get_time:
357
  lst_values["time"] = \
358
  rsi_df["Time"].apply(lambda x:
 
349
  for symbol in lst_symbols:
350
  cnt += 1
351
  url = PREFIX + INDICATORS["MACD"] \
352
+ + f"?stockSymbol={symbol}&rangeSelector=4&fastPeriod=12&slowPeriod=26&signalPeriod=9"
353
  data = requests.get(url).json()
354
  rsi_df = pd.DataFrame(
355
+ data["SeriesColection"][0]["Points"]).tail(20)
356
  if get_time:
357
  lst_values["time"] = \
358
  rsi_df["Time"].apply(lambda x: