Exemplo n.º 1
0
def set_app_config():
    if os.getenv('MY_ENV') == 'home':
        return config.ConfigHome()

    elif os.getenv('MY_ENV') == 'work':
        return config.ConfigWork()
    else:
        return config.ConfigPro()


app = set_app_config()
# ______________________________________________________________________
from my_app.database import Session, Fxt_Data, Fxt_Action, Fxt_Error
from _settings import Fxt_Settings, Fxt_Current
session = Session()

########################################################################
# Global Variables

# ______________________________________
# Historical Data (numpy.array)

closes_list = None
highs_list = None
lows_list = None
timestamps_list = None
emas_list = None
smas_list = None
atr_list = None
Exemplo n.º 2
0
import numpy as np
from sqlalchemy.sql.sqltypes import Float
import my_app.config as cfg

from my_app.database import Session, Fxt_Action, Fxt_Error, Fxt_Parameters, Fxt_Settings

from my_app import ta_functions as ta

import json, sys

# ______________________________________________________________________

session = Session()

# ______________________________________________________________________


def import_settings():

    cfg.active = bool(
        int(
            session.query(Fxt_Settings).filter(
                Fxt_Settings.name == 'active').first().value))
    cfg.symbol1 = session.query(Fxt_Settings).filter(
        Fxt_Settings.name == 'symbol1').first().value.upper()
    cfg.symbol2 = session.query(Fxt_Settings).filter(
        Fxt_Settings.name == 'symbol2').first().value.upper()
    cfg.symbol = cfg.symbol1 + cfg.symbol2
    cfg.restart_time = int(
        session.query(Fxt_Settings).filter(
            Fxt_Settings.name == 'restart_time').first().value.upper())
Exemplo n.º 3
0
def set_app_config():
    if os.getenv('MY_ENV') == 'home':
        return config.ConfigHome()

    elif os.getenv('MY_ENV') == 'work':
        return config.ConfigWork()
    else:
        return config.ConfigPro()


app = set_app_config()
# ______________________________________________________________________
from my_app.database import Session, Fxt_Data, Fxt_Action, Fxt_Error
from _settings import Fxt_Settings, Fxt_Current
session = Session()

########################################################################
# Global Variables

# ______________________________________
# Historical Data (numpy.array)

closes_list     = None
highs_list      = None
lows_list       = None
timestamps_list = None
emas_list       = None
smas_list       = None
atr_list        = None