speed = (arctan(h/b)/90) * (h/b)
Scale
Slow 0 =< speed
High 1 =< speed
speed = (arctan(h/b)/90) * (h/b)
Scale
Slow 0 =< speed
High 1 =< speed
sd = [{'id': 'e270648a-d4c3-4c04-8bb8-65fbb304d6c8', 'price': '9060.00000000', 'size': '0.20000000', 'product_id': 'BTC-USD', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': True, 'created_at': '2018-03-22T03:34:41.985706Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'open', 'settled': False}, | |
{'id': '8c13b41f-2037-4a6a-b7e2-f02e06c3b10e', 'price': '9238.58000000', 'size': '0.50000000', 'product_id': 'BTC-USD', 'side': 'sell', 'type': 'limit', 'time_in_force': 'GTC', 'post_only': True, 'created_at': '2018-03-14T04:03:01.41252Z', 'fill_fees': '0.0000000000000000', 'filled_size': '0.00000000', 'executed_value': '0.0000000000000000', 'status': 'active', 'settled': False}, | |
] | |
for i in range(len(sd)): | |
if sd[i].get('price') and sd[i].get('status')=='active': | |
entryPrice = sd[i].get('price') | |
entryPrice = float(entryPrice) | |
if entryPrice > 9100: | |
fd = sd[i].get('id') |
import datetime | |
datetime.datetime.utcnow().strftime('%s.%f') | |
#1526127635.078271 | |
str(datetime.datetime.utcnow()) | |
#2018-05-12 15:20:35.078341 | |
datetime.strptime(str(datetime.utcnow()),"%Y-%m-%d %H:%M:%S.%f").strftime('%s.%f') | |
#'1526189163.717260' |
endtime = time.time() + 60 | |
while time.time() < endtime: | |
value = datetime.utcnow().strftime("%S") | |
entTime = int(value) | |
print(60 - entTime) | |
time.sleep(1) | |
if entTime == 0: | |
break | |
############ SAME THING ############# | |
currentTime = datetime.utcnow().strftime("%M") |
import talib | |
import statsmodels.api as sm | |
import pandas as pd | |
def initialize(context): | |
context.security = symbol('AAPL') | |
#set_universe(universe.DollarVolumeUniverse(floor_percentile=98.0,ceiling_percentile=100.0)) | |
def bar_data(OHLC_type, bars_nr): | |
bar_data_func = (history((bars_nr + 1), '1d', OHLC_type).iloc[0]).astype('float') |
$ git remote rm origin | |
$ git remote add origin [email protected]:aplikacjainfo/proj1.git | |
$ git config master.remote origin | |
$ git config master.merge refs/heads/master |
import sys | |
from logging.handlers import TimedRotatingFileHandler | |
import logging | |
import logging.handlers | |
from datetime import date | |
from pathlib import Path | |
def get_project_root() -> Path: | |
return Path(__file__).parent.parent |
d = [ | |
[9, 4, 0, 0], | |
[0, 6, 0, 0], | |
[0, 0, 3, 0], | |
[0, 0, 0, 4] | |
] # List matrix | |
f = 0 # initilizing for the matrix columns | |
g = 3 # The starting point | |
h = [] # Final Sentence List |
import bisect | |
import itertools | |
class World: | |
uid = 0 | |
def __init__(self, nodes, lfunc, **kwargs): |
''' | |
I really had a difficult time trying to come up with the authentication method for Primebit. I wouldn't want anyone | |
else who is a developer to go through the same challenge. | |
All the best. Happy Trading :-) | |
''' | |
from typing import Optional, Dict, Any, List | |
from requests import Request, Session, Response, request, exceptions | |
import hmac | |
import time |