LogoLogo
  • Analytics
    • Create Chart
      • Select Mode
      • Function mode
        • 1. How to import data
          • Select Data
          • Select Time Range
          • Data Setting
        • 2. How to analyze data
          • Data Details
          • Function Setting
          • How to write functions
          • Function Library
          • Function Chart Examples
        • 3. How to visualize data
          • Line & Bar Chart
          • Doughnut Chart
          • Number Chart
          • Table Chart
          • Color Setting
      • Python mode
        • 1. How to preview data
        • 2. How to analyze data
          • Python Setting
          • How to write Python
          • Python Chart Examples
        • 3. How to visualize data
          • Line & Bar Chart
          • Table Chart
    • Publish Chart
    • Chart Examples
    • Fork Chart
  • Terminal
    • Create Bot Strategy
      • 0. How to write code
      • 1. How to preview data
    • Fork Strategy
    • Strategy Examples
    • 🔜Deploy Bot
  • Workspace
    • Manage Strategy
      • Strategy Published
      • Strategy saved as draft
    • 🔜Manage Bot
  • Account Setting
    • Change Password
    • 🔜Register Exchange Account
    • 🔜Register OTP
    • 🔜Register Payment
  • library
    • 📍Function Library
    • 📍Python Library
      • Private API
        • Binance
      • Public API
  • FAQ
    • Data
      • Dataset
        • data list
      • What type of data can I use?
      • How customizable are the data?
    • Security
      • Is UnBlinked safe?
    • Account
      • I forgot my OTP device
      • I forgot password
Powered by GitBook

Copyright © 2023, UnBlinked Co., Ltd. | All rights reserved.

On this page
  • Python code
  • How to get market data
  • 1. get_raw_data
  • 2. get_raw_data_in_df
  • Information
  1. Analytics
  2. Create Chart
  3. Python mode
  4. 2. How to analyze data

How to write Python

Python code

The main goal is to put the code result you want to get into the result as a pandas.DataFrame object.

Your code will be wrapped by the following codes and be executed in this form. Be aware that import is not allowed in your code.

import math
import numpy as np
import pandas as pd
import time
import datetime
import decimal
import get_raw_data, get_raw_data_in_df # functions to get the time-series data

# The object you have to put your code's result into
result : pd.DataFrame


'''
You code runs here
'''


# Convert result into JSON array.
# The structure should be the table with the columns.

return result
        .where(pd.notnull(code_dict["result"]), None)
        .replace({np.nan: None})
        .to_dict(orient="records")


How to get market data

1. get_raw_data


2. get_raw_data_in_df

get_raw_data_in_df is 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.


Information

Python version : 3.11.1

pandas : 2.0.0

numpy : 1.24.2

PreviousPython SettingNextPython Chart Examples

Last updated 1 year ago

Unlike the , you will import the data you need in the python code. We provide some functions to import the them.

get_raw_data is a function to get the data you can find in . It returns the data as an array of dictionaries. It requires four arguments; table_name, symbol, start_time, and end_time.

Check for more detail.

Check for more detail.

function mode
data preview
here
here