📍Python Library
Functions
They are the functions available in both analytic/python mode, and terminal.
1. Get the Time-series Data
get_raw_data
is a function to get the data you can find in the data preview. It returns the data as a list of dictionaries.
Arguments
table_name
: (string) The name of the table you want to get. It can be seen right next to the data alias at data preview. Check the data list to see the list of availabletable_name
.
symbol
: (string) A category in the table_name. For instance, if thetable_name = binance_candlestick_1h
and thesymbol = BTCUSDT
, then it would return 1 hour interval candlestick data of BTCUSDT in the Binance spot market.start_time
: (string)end_time
: (string) Thestart_time
andend_time
are the time range of the data to get. They are strings of time inyyyy-MM-dd HH:mm:ss
format. You can set them bystrftime('%Y-%m-%d %H:%M:%S')
method ofdatetime.datetime
.
Returns
It returns the data in a list of the dictionaries. In the dictionary, every numeric value is decimal.Decimal
type, and time value is datetime.datetime
.
2. Get the Time-series Data in DataFrame
get_raw_data_in_df
is a function that works same as get_raw_data
, but it refines the result into pandas.DataFrame
type, and converts decimal.Decimal
type values in it into float
.
It is useful to apply methods from pandas such as ewm
to the data.
Arguments
table_name
: (string)symbol
: (string)start_time
: (string)end_time
: (string)
Returns
It returns the data in pandas.DataFrame
object. In each entry, every numeric value is float
, and the time value is datetime.datetime
.
Terminal-only Functions
Terminal-only function can be used only in the terminal, which means that they are not available in the analytics.
1. Stop Bot
It stops the bot that the code is being run. You can call this function when you want to stop your bot in a certain condition.
Do not wrap this function by try ... except
, as it is implemented by raising ShutdownException
.
Arguments
message
: (string) The message to record to the log when the function is called
Returns
None
Last updated