Skip to content

Commit

Permalink
saving progress
Browse files Browse the repository at this point in the history
  • Loading branch information
whittlem committed Aug 12, 2022
1 parent 766a8de commit b660580
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 195 deletions.
Empty file added examples/__init__.py
Empty file.
15 changes: 9 additions & 6 deletions examples/create-graphs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from models.PyCryptoBot import PyCryptoBot
from models.Trading import TechnicalAnalysis
from views.TradingGraphs import TradingGraphs
import sys
sys.path.insert(0, ".")

#app = PyCryptoBot()
from controllers.PyCryptoBot import PyCryptoBot # noqa: E402
from models.Trading import TechnicalAnalysis # noqa: E402
from views.TradingGraphs import TradingGraphs # noqa: E402

# app = PyCryptoBot()
app = PyCryptoBot('binance')
trading_data = self.get_historical_data(app.market, self.granularity)
trading_data = app.get_historical_data(app.market, app.granularity, None)

technicalAnalysis = TechnicalAnalysis(trading_data)
technicalAnalysis.add_all()
Expand All @@ -13,4 +16,4 @@
tradinggraphs.renderFibonacciRetracement(True)
tradinggraphs.renderSupportResistance(True)
tradinggraphs.renderCandlesticks(30, True)
tradinggraphs.renderArima_model_prediction(1, True)
tradinggraphs.renderArima_model_prediction(1, True)
183 changes: 0 additions & 183 deletions gui.py

This file was deleted.

8 changes: 2 additions & 6 deletions views/TradingGraphs.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
"""Plots (and/or saves) the graphical trading data using Matplotlib"""

import re
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from datetime import datetime
from datetime import datetime, timedelta

from models.Trading import TechnicalAnalysis
from models.helper.LogHelper import Logger

sys.path.append(".")


class TradingGraphs:
def __init__(self, technical_analysis):
Expand Down Expand Up @@ -379,7 +375,7 @@ def renderArima_model_prediction(self, days=30, saveOnly=False):

df = pd.DataFrame(self.df["close"])
start_date = df.last_valid_index()
end_date = start_date + datetime.timedelta(days=days)
end_date = start_date + timedelta(days=days)
pred = results_ARIMA.predict(
start=str(start_date), end=str(end_date), dynamic=True
)
Expand Down

0 comments on commit b660580

Please sign in to comment.