CryptoExcel

Crypto Excel » Docs_functions

CryptoExcel Functions

CryptoExcel comes with a powerful set of custom Excel functions (UDFs) that allow you to import real-time and historical crypto data directly into your spreadsheets. These formulas are designed to be flexible, easy to use, and fully compatible with Excel’s native features.

With CryptoExcel functions, you can build anything from a crypto portfolio tracker to live order book dashboards — without writing a single line of code.

1. How CryptoExcel functions work

CryptoExcel functions are User-Defined Functions (UDFs) written in Python. Unlike traditional VBA UDFs, they leverage modern Python libraries (CCXT, Pandas, xlOil, etc.), giving you access to powerful crypto and data analysis tools inside Excel.

You use CryptoExcel functions just like native Excel formulas:

=st_watch_trades(“binance”,”BTC/USDT”) Or, for better readability and reusability:

A1 = “binance”
A2 = “BTC/USDT”
A3 = st_watch_trades (A1, A2)

 Tip: Always use cell references in formulas instead of hardcoding values. This makes your spreadsheet easier to update and maintain.

 Note for international users: Depending on your Excel regional settings, you may need to use semicolons (;) instead of commas (,) in formulas.

1A. Function Parameters

Most CryptoExcel functions have required and optional parameters:

  • Required parameters: must be provided for the function to work (e.g., exchange, trading pair).

  • Optional parameters: allow advanced customization (e.g., time precision, filters).

Example with optional parameters:

=st_watch_trades ("binance","BTC/USDT", , , 1)

In this case, the exchange and symbol are required, while the 6th parameter activates millisecond timestamp precision for trades.

function-watch-trade
Function Watch Trade

2. How CryptoExcel Functions Update

2A. HTTP vs WebSocket connection

CryptoExcel connects to exchanges using two different methods:

  • HTTP Requests – Best for simple, one-time queries (e.g., fetching your balance). The Add-In sends a request, the exchange replies, and the connection closes.

  • WebSockets – Keeps the connection open for real-time communication. Ideal for continuous updates like order books or trade history.

Why this matters: Exchanges enforce rate limits. Each HTTP request counts toward your limit, while WebSocket connections are more efficient for live streaming data.

2B. Update timing in CryptoExcel

CryptoExcel manages updates with two different timing rules:

  1. Throttle Time

    • Applies to HTTP requests.

    • Defines the minimum time between two consecutive queries.

  2. Update Time

    • Applies to WebSocket streams.

    • Data arrives continuously, but CryptoExcel only refreshes Excel at specific intervals for performance.

2C. WebSocket Functions in Excel

Functions using WebSockets are easy to identify because they include watch in their names.
Example:

=ST_WATCH_TRADES("binance","BTC/USDT",5)

This will keep your trade history streaming every 5 seconds even if the python running in the background is updated more frequently.

2D. Real-Time Data (RTD) Integration

CryptoExcel leverages Excel’s built-in RTD (Real Time Data) engine. By default, Excel limits RTD updates to once every 2 seconds.

  • You can change the RTD throttle interval if you need faster or slower updates.

  • Values are set in seconds and support decimals (e.g., 0.5 for half a second).

  • Keep in mind: once changed, the setting is persistent and will remain even after closing and reopening Excel

3. Functions support in Excel

CryptoExcel supports the function wizard, also known as the Insert Function dialog box. You can access it by clicking the ‘fx’ button next to the formula bar or by going to the Formulas tab and selecting Insert Function.  We use the following group:

  • Public
  • Private
  • Portfolio
  • Indicators
  • Analysis
  • Utility

 Tip: write = st_ in a cell and you will se an handy list with all the CryptoExcel functions

3A. functions' list

Public Functions

Private Functions

  • Instantiate
  • Balance
  • Balance Trh
  • Balance Converted
  • Balance Converted Trh
  • Balance History
  • Balance History Trh

Utility

  • Supported Exchanges
  • Supported Functions
  • OHLCV Tf
  • OHLCV Watch Tf
  • Watch Exceptions
  • Watch Request
  • Symbol Info
  • Debug
  • Alert

Analysis

  • PortVar
  • Stat Port
  • Stat Trades
  • Graph Equity Line

Technical Indicators

  • Rsi
  • Sma
  • Wma
  • Ema
  • Macd
  • Percent Return
  • Log Return
  • DrowDown
  • Cross Above
  • Cross Below