class Simian(trader):
def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
self.__dict__.update({k : eval(v) for k, v in os.environ.items() if k in self.envars})
with open("params.json", 'r') as fp:
self.__dict__.update(json.load(fp)[self.args.name])
self.ibkr_init(self.account)
self.db = db_connect(self.dbname)
self.date = dt.datetime.today()
def place_orders(self, symbols, qty):
self._submit_order(symbols, qty, ['BUY', 'SELL', 'SELL', 'BUY'], 'MKT', 'DAY', order_class='multileg')
def cache(self):
self.refresh_lst()
self.ibkr_touch()
self.chain = self.ibkr_chain(self.underlying, dt.datetime.now())
def trade(self):
try:
schedule.clear()
self.schedule_at(self.cache, '06:00')
try:
self.bp = self.get_equity()
except Exception:
logging.error(traceback.format_exc())
print('Failed to retrieve ledger, retrying in 5...')
sleep(5)
self.bp = self.get_equity()
for qty, t in zip(self.qtys, self.times):
self.schedule_at(self.open, hour=t.hour, minute=t.minute, qty=int(qty))
self.wait()
except Exception:
logging.error(traceback.format_exc())
Funds are the products we offer to investors and may be comprised of one or many strategies working in concert. Fund performance is reported inclusive of fees.
Strategies are the components which we combine to assemble the different Fund products. Strategy performance is reported exclusive of fees.