def __init__(self):
        logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(levelname)-6s %(message)s')
        self._log = logging.getLogger()

        config_path = os.path.join(os.path.expanduser('~'), '.shipane_sdk', 'config', 'scheduler.ini')
        self._log.info('Config path: %s', config_path)
        self._config = ConfigParser()
        self._config.readfp(codecs.open(config_path, "r", "utf8"))

        self._client = Client(host=self._config.get('ShiPanE', 'host'),
                              port=self._config.get('ShiPanE', 'port'),
                              key=self._config.get('ShiPanE', 'key'))
        self._jq_client = JoinQuantClient(username=self._config.get('JoinQuant', 'username'),
                                          password=self._config.get('JoinQuant', 'password'),
                                          backtest_id=self._config.get('JoinQuant', 'backtest_id'))
        self._rq_client = RiceQuantClient(username=self._config.get('RiceQuant', 'username'),
                                          password=self._config.get('RiceQuant', 'password'),
                                          run_id=self._config.get('RiceQuant', 'run_id'))

        self._new_stock_purchase_job = NewStockPurchaseJob(self._config, self._client)
        self._jq_following_job = OnlineQuantFollowingJob(self._client, self._jq_client, 'JoinQuantFollowingJob')
        self._rq_following_job = OnlineQuantFollowingJob(self._client, self._rq_client, 'RiceQuantFollowingJob')
Example #2
0
 def setUp(self):
     config = ConfigParser()
     dir_path = os.path.dirname(os.path.realpath(__file__))
     config.read('{}/../config/config.ini'.format(dir_path))
     self.client = Client(host=config.get('ShiPanE', 'host'))
Example #3
0
if six.PY2:
    ConfigParser = configparser.RawConfigParser
else:
    ConfigParser = configparser.ConfigParser

from shipane_sdk import Client
from shipane_sdk.joinquant.client import JoinQuantClient
from shipane_sdk.joinquant.runner import JoinQuantRunner

if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)-15s %(levelname)-6s %(message)s')

    dir_path = os.path.dirname(os.path.realpath(__file__))

    config = ConfigParser()
    config.read('{}/config/config.ini'.format(dir_path))

    shipane_client = Client(host=config.get('ShiPanE', 'host'),
                            port=config.get('ShiPanE', 'port'),
                            key=config.get('ShiPanE', 'key'))
    jq_client = JoinQuantClient(username=config.get('JoinQuant', 'username'),
                                password=config.get('JoinQuant', 'password'),
                                backtest_id=config.get('JoinQuant',
                                                       'backtestId'))
    jq_client.login()
    runner = JoinQuantRunner(shipane_client, jq_client, interval=15)

    runner.run()
 def setUp(self):
     logging.basicConfig(level=logging.DEBUG)
     config = ConfigParser()
     dir_path = os.path.dirname(os.path.realpath(__file__))
     config.read('{}/../config/config.ini'.format(dir_path))
     self.client = Client(logging.getLogger(), host=config.get('ShiPanE', 'host'), key=config.get('ShiPanE', 'key'))