This file contains 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 requests | |
data = requests.get('https://api.binance.com/api/v1/exchangeInfo').json() | |
data = filter(lambda x: x['isMarginTradingAllowed'], data['symbols']) | |
symbols = map(lambda x: 'BINANCE:{}'.format(x['symbol']), data) | |
symbols = filter(lambda x: 'BTC' in x, symbols) | |
print(','.join(symbols)) |
This file contains 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 ccxt | |
import pandas as pd | |
import time | |
bfx = ccxt.bitfinex2() | |
def fetch(since, limit=1000): | |
header = ['Timestamp', 'Open', 'High', 'Low', 'Close', 'Volume'] | |
data = bfx.fetch_ohlcv('BTC/USD', '1h', since=since, limit=limit) | |
df = pd.DataFrame(data, columns=header).set_index('Timestamp') |
This file contains 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
BINANCE:ETHBTC | |
BINANCE:LTCBTC | |
BINANCE:BNBBTC | |
BINANCE:NEOBTC | |
BINANCE:BCCBTC | |
BINANCE:GASBTC | |
BINANCE:HSRBTC | |
BINANCE:MCOBTC | |
BINANCE:WTCBTC | |
BINANCE:LRCBTC |
This file contains 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 ccxt.async as ccxt | |
import logging | |
import pandas as pd | |
from pyti.simple_moving_average import simple_moving_average as sma | |
logger = logging.getLogger() | |
handler = logging.StreamHandler() | |
formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s') |
This file contains 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 sys | |
import websockets | |
import asyncio | |
import json | |
import signal | |
from datetime import datetime | |
from datetime import timezone | |
class bcolors: |
This file contains 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 requests | |
data = requests.get('https://api.binance.com/api/v1/ticker/24hr').json() | |
print("ticker,volume,trade_count") | |
for pair in data: | |
symbol = pair['symbol'] | |
volume = pair['volume'] | |
trade_cnt = pair['count'] | |
print("{},{},{}".format(symbol, volume, trade_cnt)) |
This file contains 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 pickle | |
from math import log | |
from pprint import pprint | |
from bittrex import bittrex as btr | |
from bittrex.bittrex import Bittrex | |
import networkx as nx | |
from numpy import roll | |
This file contains 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 requests | |
data = requests.get('https://api.binance.com/api/v1/exchangeInfo').json() | |
symbols = map(lambda x: 'BINANCE:{}'.format(x['symbol']), data['symbols']) | |
symbols = filter(lambda x: 'BTC' in x, symbols) | |
print(','.join(symbols)) |
This file contains 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 io.undertow.Handlers; | |
import io.undertow.Undertow; | |
import io.undertow.server.handlers.*; | |
import io.undertow.util.Headers; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public class UndertowServer { | |
public static void main(String[] args) { | |
Logger logger = LogManager.getLogger(UndertowServer.class); |