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
  1. Terminal
  2. Create Bot Strategy

0. How to write code

Code area

After setting the scheduler type, you will see an empty code area. You can write your own code in this area, and once the bot runs, it will execute the code for each time scheduled by the scheduler type.

When the code is actually executed, it will be wrapped like below, so that the methods and functions called in the code work properly.

Be aware that import is not allowed in your code.

After running your code, the variables will not be preserved in the memory. In other words, the variables saved at the end of the previous schedule are not accessible at the beginning of the next schedule.

# Available libraries
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

import PublicAPI # A class to send public API requests  
import PrivateAPI # A class to send private API requests

# publicAPI is automatically initiated.
# privateAPI is automatically initiated by your API keys.
publicAPI = PublicAPI()
privateAPI = PrivateAPI(*api_keys)

# --------------------------------------------------------

'''
You code runs here
'''

PreviousCreate Bot StrategyNext1. How to preview data

Last updated 1 year ago