-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconstants.py
64 lines (52 loc) · 1.91 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# =============================================================================
# File: constants.py
# Author: Andre Brener
# Created: 12 Jun 2017
# Last Modified: 23 Sep 2017
# Description: description
# =============================================================================
from datetime import date
import pandas as pd
from get_portfolio import get_positions
from get_coin_names import get_coin_info
from google_credentials import POSITION_SHEET_LINK, RANGE_NAME
from sklearn.linear_model import LinearRegression
BTC_GRADIENT_DAYS = 7
TECHNICAL_ANALYSIS = {
'bollinger_bands': (20, 2.5),
'roll_mean_1': (13, 21),
'roll_mean_2': (21, 55),
'macd_1': (12, 29, 9),
'macd_2': (5, 34, 1),
'rsi_1': (14)
}
LINEAR_PARAMS = {
'fit_intercept': [True, False],
'normalize': [True, False],
}
MODELS = {'LinearRegression': (LinearRegression(), LINEAR_PARAMS)}
MAX_BTC_BUY = 0.8
MAX_SELL_PERCENTAGE = 0.3
MIN_EARNINGS = 0.05
PRICE_PERIODS = 7
COIN_DATA_DAYS = 501
FEE_PERC = 0.1
TOP_COINS = 10
MAIL_NAME = 'Andre Brener'
MAIL_ADDRESS = 'brener.andre@gmail.com'
MAIL_SENDER = 'Andre Finance <crypto@andre.com>'
MAIL_SUBJECT = 'Cryptocurrency Recommendations - {}'.format(date.today())
MAIL_RESPONSE_ADDRESS = 'brener.andre@gmail.com'
MAIL_SIGNATURE = 'Andre Brener'
COIN_DATA_DF, BTC_AVAILABLE = get_positions(POSITION_SHEET_LINK, RANGE_NAME)
COIN_MK_CAPS = pd.read_csv('data/historical_market_caps_btc.csv')
COIN_MK_CAPS['date'] = pd.to_datetime(COIN_MK_CAPS['date'])
NAMES_URL = 'https://coinmarketcap.com/all/views/all/'
LOGOS_URL = 'https://coinranking.com/'
COIN_NAMES_DF = get_coin_info(NAMES_URL, LOGOS_URL)
COIN_NAMES_HEAD = COIN_NAMES_DF.head(TOP_COINS)
COIN_DATA_TEMP = pd.merge(COIN_DATA_DF, COIN_NAMES_DF, how='left').fillna(0)
COIN_DATA_DF = pd.concat([
COIN_DATA_TEMP, COIN_NAMES_HEAD
]).drop_duplicates().fillna(0).groupby('coin').max().reset_index()
# print(COIN_DATA_DF)