Ejemplo n.º 1
0
from observer import controller_cython as controller
cont = controller.Controller('/home/ubuntu/settings_triangle.conf','live')
cont.retrieve_data(4, completed = False, upsert = True)
cont.data2sheet(complete = False)
allowed_ins = [ins.name for ins in cont.allowed_ins]
returns = [cont.open_limit(ins, close_only = True, complete = False) for ins in allowed_ins]
cont_demo = controller.Controller('/home/ubuntu/settings_triangle.conf','demo')
returns = [cont_demo.open_limit(ins, close_only = True, complete = False) for ins in allowed_ins]
Ejemplo n.º 2
0
from observer import controller_cython as controller
import datetime
cont = controller.Controller('/home/tubuntu/settings_triangle.conf','demo')
now = datetime.datetime.now()
yesterday = now - datetime.timedelta(hours=24)
cont.save_prediction_to_db(yesterday.strftime('%Y-%m-%d'))
Ejemplo n.º 3
0
from observer import controller_cython as controller
cont = controller.Controller('/home/tubuntu/settings_triangle.conf', 'live')
allowed_ins = [ins.name for ins in cont.allowed_ins]
returns = [cont.open_limit(ins) for ins in allowed_ins]
cont_demo = controller.Controller('/home/tubuntu/settings_triangle.conf',
                                  'demo',
                                  write_trades=True,
                                  multiplier=10)
returns = [cont_demo.open_limit(ins) for ins in allowed_ins]
Ejemplo n.º 4
0
try:
    from observer import controller_cython as controller
except ImportError:
    print('WARNING: Cython module not found, falling back to native python')
    from observer import controller as controller
cont = controller.Controller('../settings_triangle.conf', None)
cont.get_feature_importances()
Ejemplo n.º 5
0
try:
    from observer import controller_cython as controller
except ImportError:
    print('WARNING: Cython module not found, falling back to native python')
    from observer import controller as controller

cont = controller.Controller('../settings_triangle.conf', None, verbose=2)
#cont.data2sheet(improve_model=True, write_predict=False, write_raw=True, read_raw=False)
cont.data2sheet(improve_model=True,
                write_predict=False,
                write_raw=True,
                read_raw=False,
                append_raw=True)
Ejemplo n.º 6
0
try:
    from observer import controller_cython as controller
    # from observer import controller as controller
except ImportError:
    print('WARNING: Cython module not found, falling back to native python')
    from observer import controller as controller
cont = controller.Controller('../settings_triangle.conf', 'live', verbose=1)
cont.save_spreads()
Ejemplo n.º 7
0
from observer import controller_cython as controller
#from observer_keras import controller_cython as controller_keras

settings_file = '/home/tubuntu/settings_triangle.conf'
cont = controller.Controller(settings_file, 'live')
cont.retrieve_data(4, completed=False, upsert=True)
cont.predict_tomorrow()
Ejemplo n.º 8
0
import time
import datetime
try:
    from observer import controller_cython as controller
    #from observer import controller as controller
except ImportError:
    print('WARNING: Cython module not found, falling back to native python')
    from observer import controller as controller
while True:
    sleep_time = 60 * 10  # sleep for 10 min if credit count available
    try:
        cont = controller.Controller('/home/tubuntu/settings_triangle.conf',
                                     'live',
                                     verbose=0)
        cont.data2sheet(improve_model=True,
                        write_predict=False,
                        write_raw=True,
                        read_raw=False,
                        append_raw=True)
    except Exception as e:
        print(e)
    time.sleep(sleep_time)
Ejemplo n.º 9
0
from observer import controller_cython as cobs

print('live')
oco = cobs.Controller('/home/tubuntu/settings_triangle.conf', 'live')
oco.move_stops()
print('demo')
ocodemo = cobs.Controller('/home/tubuntu/settings_triangle.conf', 'demo')
ocodemo.move_stops()