Skip to content

Instantly share code, notes, and snippets.

View thecodingrobot's full-sized avatar

N.S. thecodingrobot

View GitHub Profile
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))
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')
BINANCE:ETHBTC
BINANCE:LTCBTC
BINANCE:BNBBTC
BINANCE:NEOBTC
BINANCE:BCCBTC
BINANCE:GASBTC
BINANCE:HSRBTC
BINANCE:MCOBTC
BINANCE:WTCBTC
BINANCE:LRCBTC
@thecodingrobot
thecodingrobot / scanner.py
Created May 9, 2018 18:06
shitcoin scanner
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')
import sys
import websockets
import asyncio
import json
import signal
from datetime import datetime
from datetime import timezone
class bcolors:
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))
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
@thecodingrobot
thecodingrobot / binance-pairs.py
Last active July 8, 2019 03:00
Binance BTC pairs to Tradingview watchlist
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))
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);