Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…gorithm-server into ta-lib
  • Loading branch information
fou3fou3 committed Oct 4, 2023
2 parents 39ab5e7 + b020c91 commit 9fb851c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion algorithms/bollinger_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def signal(data):
upper_band, lower_band, middle_band = data
if middle_band[-1] > upper_band[-1]:
return 'sell', 1
if middle_band[-1] < lower_band[-1]:
elif middle_band[-1] < lower_band[-1]:
return 'buy', 0.5
return 'no_action', 0
4 changes: 2 additions & 2 deletions algorithms/macd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def algorithm(prices, window_sizes=[12, 26, 9]):

def signal(data):
macd, signal = data
# @TODO make this not stupid :3
# Done i made it "not stupid XD"
if macd[-1] > signal[-1]:
return 'sell'
if macd[-1] < signal[-1]:
elif macd[-1] < signal[-1]:
return 'buy'
return 'no_action'
2 changes: 1 addition & 1 deletion algorithms/rsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ def signal(data):
rsi = data
if rsi[-1] > 70:
return 'sell'
if rsi[-1] < 30:
elif rsi[-1] < 30:
return 'buy'
return 'no_action'

0 comments on commit 9fb851c

Please sign in to comment.