Skip to content

Commit

Permalink
Add .idea to gitignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopetiz committed Nov 24, 2020
1 parent ea4e174 commit bec9acd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -28,3 +28,4 @@ parallel.py
tmp
pypy*
.pytest_cache
.idea/
4 changes: 2 additions & 2 deletions cryptoalgotrading/cryptoalgotrading.py
Expand Up @@ -51,7 +51,7 @@ def signal_handler(sig, frame):
simplefilter(action='ignore', category=FutureWarning)


#@safe
@safe
def is_time_to_exit(data,
funcs,
smas=var.default_smas,
Expand Down Expand Up @@ -85,7 +85,7 @@ def is_time_to_exit(data,
return False


#@safe
@safe
def is_time_to_buy(data,
funcs,
smas=var.default_smas,
Expand Down
40 changes: 11 additions & 29 deletions cryptoalgotrading/var.py
Expand Up @@ -7,7 +7,7 @@
framework if user wants to use DB and Exchanges' credentials.
"""

from os import environ
from os import environ, getenv
#import lib_bittrex

log = True
Expand All @@ -16,33 +16,19 @@
# DATABASE VARIABLES
# Best option should be define vars on system
# and then get environment variables.
try:
db_user = environ['DB_USER']
db_password = environ['DB_PASSWD']
db_name = environ['DB_NAME']

except Exception as e:
print(f"Could not use environment user and password variables-> {e}")
db_user = "user"
db_password = "passwd"
db_name = "bd"

if 'DATA_DIR' in environ:
data_dir = environ['DATA_DIR']
else:
data_dir = "."

if 'LOGS_DIR' in environ:
logs_dir = environ['LOGS_DIR']
else:
logs_dir = "."
db_user = getenv('DB_USER') or "user"
db_password = getenv('DB_PASSWD') or "passwd"
db_name = getenv('DB_NAME') or "bd"

data_dir = getenv('DATA_DIR') or "."
logs_dir = getenv('LOGS_DIR') or "."

LOG_FILENAME = logs_dir + '/indicators.log'

fig_dir = "figs/"

db_host = 'localhost'
db_port = 8086
db_host = getenv('db_host') or 'localhost'
db_port = getenv('db_port') or 8086

# interval must be coincident with Influxdb intervals.
default_interval = '10m'
Expand All @@ -61,12 +47,8 @@

exchange = 'bittrex'

try:
ky = environ['API_KEY']
sct= environ['API_SECRET']
except Exception as e:
print(f"Could not use environment variables for key and secret->{e}")
#pass
ky = getenv('API_KEY') or ""
sct= getenv('API_SECRET') or ""

# Add API Key and API Secret as variables if needed.
#try:
Expand Down

0 comments on commit bec9acd

Please sign in to comment.