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

Commit

Permalink
Revert "algorithm update (#26)"
Browse files Browse the repository at this point in the history
This reverts commit 4f24e9f.
  • Loading branch information
CelestialCrafter authored Nov 3, 2023
1 parent 4f24e9f commit 0cfdbc2
Show file tree
Hide file tree
Showing 19 changed files with 116 additions and 421 deletions.
151 changes: 0 additions & 151 deletions .dockerignore

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/docker.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion algorithms/bollinger_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def algorithm(prices, window_size=20, standard_deviations=2):
return upper_band, lower_band, middle_band

def signal(prices, data):
upper_band, lower_band, middle_band = data
upper_band, lower_band, middle_band, prices = data
if prices[-1] > upper_band[-1]:
return 'sell', 1
elif prices[-1] < lower_band[-1]:
Expand Down
6 changes: 3 additions & 3 deletions algorithms/rsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def algorithm(prices, window_size=14):
def signal(prices, data, high=70, low=30):
rsi = data
if rsi[-1] > high:
return 'sell', 0.5
return 'sell'
elif rsi[-1] < low:
return 'buy', 0.5
return 'no_action', 0
return 'buy'
return 'no_action'
10 changes: 3 additions & 7 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dotenv import load_dotenv
from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from views import internal_checker, plot, worth
from views import bot_net_worth, internal_checker, plot

load_dotenv()

Expand All @@ -10,10 +10,6 @@

app.add_url_rule('/plot/<algorithm>', view_func=plot.plot)
app.add_url_rule('/internal_checker', view_func=internal_checker.internal_checker)
app.add_url_rule('/worth/<bot_id>', view_func=worth.worth)
app.add_url_rule('/profit/<bot_id>', view_func=bot_net_worth.bot_net_worth)

if __name__ == '__main__':
app.run()

def get_app():
return app
app.run()
Loading

0 comments on commit 0cfdbc2

Please sign in to comment.