Skip to content

Instantly share code, notes, and snippets.

View MtkN1's full-sized avatar

machuken MtkN1

View GitHub Profile
import hashlib
import hmac
import json
import time
import urllib.parse
from threading import Thread
from collections import deque
from requests import Request, Session
from requests.exceptions import HTTPError
import json
import time
# ①クラスをインポートする
from pybybit import Bybit
if __name__ == '__main__':
# ②インスタンスを生成、パラメーターを設定する
bybit = Bybit(api_key='xxxx',
secret='yyyy', symbol='BTCUSD', ws=True, test=True)
@MtkN1
MtkN1 / gmocoiner_usage.py
Created June 6, 2019 15:35
gmocoiner usage
import json
from gmocoiner import GMOCoin
if __name__ == '__main__':
api_key = 'YOUR_API_KEY'
secret = 'YOUR_SECRET_KEY'
gmo = GMOCoin(api_key, secret, late_limit=True, logger=None)
@MtkN1
MtkN1 / try_pybybit.py
Last active August 10, 2020 10:20
Try PyBybit
# pybybitのインポート
import pybybit
# (当説明スクリプト上で使うインポート)
from pprint import pp
import time
# API情報を入力
apis = [
@MtkN1
MtkN1 / bar.py
Created March 13, 2021 03:07
Note Preview Sample
msg = 'bar'
print(f'hello, {msg}!')
import http.client
import json
import time
import urllib.request
def main() -> None:
print('絶対に負けないbotを起動しました...Ctrl+Cで終了')
while True:
print('売買判断...')
@MtkN1
MtkN1 / cryptocurrency-exchange-fees-jp.md
Last active May 2, 2021 08:20
暗号資産🇯🇵取引所の現物手数料まとめ

Bitcoin

🏦 Exchange 💱 Trading Fee 📤 Withdrawal Fee 📝 memo
bitFlyer 0.15 ~ 0.01 % 0.0004 BTC
Liquid 0.0 % 0.0007 BTC
bitbank -0.02 / 0.12 % 0.0006 BTC 💱 Maker / Taker
SBIVCTrade 0.0 % 0.0 BTC
GMOcoin -0.01 / 0.05 % 0.0 BTC 💱 Maker / Taker
HuobiJapan 0.1 ~ 0.008 % /0.1 ~ 0.024 % 0.0005 BTC 💱 Maker / Taker
@MtkN1
MtkN1 / bybit_futures_symbol_names.py
Last active June 28, 2022 01:36
Bybit Futures Symbol Names
import http.client
import json
import urllib.request
resp: http.client.HTTPResponse
with urllib.request.urlopen('https://api.bybit.com/v2/public/symbols') as resp:
data = json.loads(resp.read().decode())
print(*filter(lambda x: all([x['name'] != x['alias'], x['status'] == 'Trading']), data['result']), sep='\n\n')
import asyncio
from typing import Any, Dict
import motor.motor_asyncio
import pybotters
class BybitMongoDB:
def __init__(self):
client = motor.motor_asyncio.AsyncIOMotorClient()
import asyncio
import itertools
import time
import aiohttp
"""
WebSocket テストクライアント
テストサーバーに接続して 0 から始まるサーバーのカウンターとローカルのカウンターの一致を照合する。
カウンターが 10 の時点で CPU バウンドのブロッキング処理を行う。(1億回ループの加算、自環境10秒程度)