This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RollingStatistic(object): | |
def __init__(self, window_size, average, variance): | |
self.N = window_size | |
self.average = average | |
self.variance = variance | |
self.stddev = sqrt(variance) | |
def update(new, old): | |
oldavg = self.average |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import hashlib | |
import base64 | |
from pprint import pformat | |
import json | |
import asyncio | |
from collections import OrderedDict | |
from websockets import connect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def long_coro(): | |
await asyncio.sleep(1000) | |
async def fail_coro(): | |
raise ValueError | |
async def timeout_coro(): | |
print('start') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import zmq.asyncio | |
import logging | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
sh = logging.StreamHandler() | |
sh.setLevel(logging.DEBUG) | |
logger.addHandler(sh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import sys | |
import logging | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
sh = logging.StreamHandler() | |
sh.setLevel(logging.DEBUG) | |
logger.addHandler(sh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import logging | |
from contextlib import closing | |
import datetime | |
from sshtunnel import SSHTunnelForwarder | |
from cmreslogging.handlers import CMRESHandler | |
logger = logging.getLogger(__name__) |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
254'), 'token': None, 'aggregatedCap': Decimal('1'), 'timestamp': 1542383692233} | |
2018-11-16 16:54:55,699 - theo_calculator.py:263 - INFO - found_eff_vol=60000.00000000000000000000000 | |
2018-11-16 16:54:55,699 - theo_calculator.py:266 - INFO - total_eff_vol_for_theo=53.54822760785947532988284620 | |
2018-11-16 16:54:55,699 - theo_calculator.py:268 - INFO - total_vol_for_theo=0.009672938653992030036925841023 | |
2018-11-16 16:54:55,699 - theo_calculator.py:276 - INFO - calculate_theo: processed 7 trades (found_eff_vol=60000.00000000000000000000000 >= eff_max_vol=60000) | |
2018-11-16 16:54:55,699 - theo_calculator.py:290 - INFO - Trade theo=5535.879997105127519920974511, total_eff_vol_for_theo=53.54822760785947532988284620, total_vol_for_theo=0.009672938653992030036925841023 | |
update theo in 0.0041997432708740234sec | |
2018-11-16 16:54:55,997 - run.py:77 - INFO - get 1 trades for gemini {'since': 1542383681457, 'limit': 500} | |
2018-11-16 16:54:55,997 - run.py:79 - INFO - trades[0]: {'id': '4817350539', 'order': None, 'info': {'time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
N_EXPERIMENTS = 10000 | |
N_SWIPES = 250 | |
A_REAL_RATE = 66 / 250 | |
B_REAL_RATE = 70 / 250 | |
def experiment(): | |
""" observable rate for A and B """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time.mktime(datetime.strptime('2019-01-07 09:43:20,158', '%Y-%m-%d %H:%M:%S,%f').timetuple()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apm-server: | |
image: docker.elastic.co/apm/apm-server:6.7.1 | |
# image: docker.elastic.co/apm/apm-server:6.5.3 | |
command: -strict.perms=false | |
volumes: | |
- /etc/localtime:/etc/localtime:ro | |
- ./apm/apm-server.yml:/usr/share/apm-server/apm-server.yml | |
depends_on: | |
- es-tunnel | |
logging: |