python-binance

helpers

funcdate_to_milliseconds(date_str) -> int

Convert UTC date to milliseconds

If using offset strings add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"

See dateparse docs for formats http://dateparser.readthedocs.io/en/latest/

:param date_str: date in readable format, i.e. "January 01, 2018", "11 hours ago UTC", "now UTC"

paramdate_strstr

Returns

int
funcinterval_to_milliseconds(interval) -> Optional[int]

Convert a Binance interval string to milliseconds

:param interval: Binance interval string, e.g.: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w

:return: int value of interval in milliseconds None if interval prefix is not a decimal integer None if interval suffix is not one of m, h, d, w

paramintervalstr

Returns

typing.Optional[int]
funcround_step_size(quantity, step_size) -> float

Rounds a given quantity to a specific step size

:param quantity: required :param step_size: required

:return: decimal

paramquantityUnion[float, Decimal]
paramstep_sizeUnion[float, Decimal]

Returns

float
funcconvert_ts_str(ts_str)
paramts_str

Returns

None
funcconvert_list_to_json_array(l)
paraml

Returns

None
funcget_loop()

check if there is an event loop in the current thread, if not create one inspired by https://stackoverflow.com/questions/46727787/runtimeerror-there-is-no-current-event-loop-in-thread-in-async-apscheduler

Returns

None