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 | |
class ExchangeInfo: | |
def __get__( self, *args ): | |
return self.value | |
def __set__( self, obj, value=None ): | |
if value is None: |
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
from math import floor | |
def get_purchase_quantity( raw_quantity:float, step_size:str ) -> float: | |
if float( step_size ) % 1 == 0: | |
return round( raw_quantity / float( step_size ) ) * float( step_size ) | |
return round( raw_quantity, step_size.index( '1' ) - 1 ) | |
def get_sale_quantity( raw_quantity:float, step_size:str ) -> float: | |
if float( step_size ) % 1 == 0: |
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
def get_binance_pairs(self,**kwargs): | |
base_currencies = kwargs.get('base_currencies','') | |
quote_currencies= kwargs.get('quote_currencies','') | |
input_pairs = None | |
binance_pairs = list() | |
def _clean(_input): | |
return _input.strip().upper() | |
exchange_info = binance.client.Client(None,None).get_exchange_info() |
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
from time import sleep | |
from datetime import datetime | |
from binance.client import Client | |
from binance.helpers import date_to_milliseconds, interval_to_milliseconds | |
SECONDS_IN_MINUTE = 60 | |
def _sample_crude_api_limiting(headers, threshold=1190, delay_buffer=5, weight_updates=False, sleep_updates=True, force_sleep=False): | |
if headers: |
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
from time import sleep | |
from datetime import datetime | |
from binance.client import Client | |
SECONDS_IN_MINUTE = 60 | |
def _sample_crude_api_limiting(headers, threshold=6, delay_buffer=5): | |
used_api_weight = headers.get('x-mbx-used-weight-1m', 0) | |
print(f'Used API Weight: {used_api_weight}') |
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
from random import choice | |
def whisper_sweet_nothings(name): | |
sweet_nothings = [ | |
"{}, you're a gift to those around you.".format(name), | |
"I appreciate you {}.".format(name), | |
"{}, when you say you will do something, I trust you.".format(name), | |
"{}, your eyes are breathtaking.".format(name), | |
"{}, you make me want to be the best version of myself.".format(name), | |
"{}, simply knowing you has made me a better person.".format(name), |
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
from math import floor | |
from binance.client import Client | |
def purchase_rounding(step_size,trade_quantity): | |
if step_size == '1.00000000': | |
return round(trade_quantity,0) | |
else: | |
return round(trade_quantity,step_size.index("1")-1) | |
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
from flask import abort, make_response, jsonify | |
from decimal import Decimal | |
import random | |
import string | |
from time import time | |
from operator import itemgetter | |
import hashlib | |
import hmac | |
import json |
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
from time import time | |
import requests | |
import hashlib | |
import hmac | |
import os | |
test = True | |
start = time() | |
api_key = os.getenv("api_key") |
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 os | |
for root, dirs, files in os.walk(os.getcwd(), topdown=False): | |
for name in files: | |
if name.endswith(".csv") and name[4:7] == "-9-": | |
new_name = name.replace("-9-","-09-") | |
old_filepath = os.path.join(root, name) | |
new_filepath = os.path.join(root, new_name) | |
command = f'mv {old_filepath} {new_filepath}' | |
os.system(command) |
NewerOlder