TSLab
TSLab.proSupportTSLab LiveTSVerse
Eng
Eng
  • TSLab trading platform
  • For newbies
    • A beginner's guide
      • Purchasing a license key for a data provider
      • An example of connecting text quotes
      • Example of connecting a data provider to a broker / exchange
      • An example of creating a script in TSLab
      • An example of creating a trading algorithm in TSLab
  • Installing TSLab
    • TSLab Installation Guide
      • System requirements
      • TSLab Installation manual
    • Update TSLab
      • Preparing for update
      • Release build
      • Nightly build
    • Restarting the TSLab program
    • TSLab Changelog
      • TSLab 2.1 Changelog
      • TSLab 2.2 Changelog
        • 2.2.26.0 - 2024/01/31
        • 2.2.25.0 - 2024/01/17
        • 2.2.24.0 - 2024/12/04
        • 2.2.23.0 - 2024/09/19
        • 2.2.22.0 - 2024/08/30
        • 2.2.21.0 - 2024/05/17
        • 2.2.20.0 - 2024/05/15
        • 2.2.19.0 - 2024/02/21
        • 2.2.18.0 - 2024/02/09
        • 2.2.17.0 - 2023/11/16
        • 2.2.16.0 - 2023/10/20
        • 2.2.15.0 - 2023/10/13
        • 2.2.14.0 - 2023/08/11
        • 2.2.13.0 - 2023/05/12
        • 2.2.12.0 - 2023/02/28
        • 2.2.11.0 - 2022/12/15
        • 2.2.10.0 - 2022/10/27
        • 2.2.9.0 - 2022/09/16
        • 2.2.7.0 - 2022/06/23
        • 2.2.5.0 - 2022/04/29
        • 2.2.3.0 - 2022/04/01
        • 2.2.2.0 - 2021/12/29
  • Data providers
    • Cryptocurrency exchanges
      • Binance Cryptocurrency Exchange
        • Registration on Binance
          • Registration on Binance Exchange website
          • Configure Binance Wallet
          • Creating a Binance API Key for TSLab
          • Binance. Transferring USDT from wallet to wallet without commission
        • Registration on TSLab [Binance]
          • Account registration on the TSLab website [Binance]
          • Creating a free Binance Data Provider for TSLab
        • Setting up a Binance Data Provider in TSLab
        • TSLab Binance Edition
          • Starting the program
          • Configuring the Binance Data provider
      • Bitget Cryptocurrency Exchange
        • Registration on the Bitget official website
        • Creating a Free Bitget Data Provider
        • Configuring the Bitget Data Provider in TSLab
      • ByBit Cryptocurrency Exchange
        • Registration on the ByBit website
        • Creating a free ByBit data provider
        • Configuring the ByBit Data Provider in TSLab
      • Deribit Cryptocurrency Exchange
        • Deribit data provider settings
        • Deribit. Frequently asked questions and useful information
        • Deribit. Possible problems and solutions
        • Deribit Margin Requirements Calculation
        • An example of a ready-made script for Deribit
      • Kucoin Cryptocurrency Exchange
        • Registration on the KuCoin official website
        • Creating an API key on the KuCoin website
        • Issuing a free license for KuCoin Data Provider
        • Setting up the KuCoin data provider in TSLab
      • OKX Cryptocurrency Exchange
        • Setting up an OKX account
          • Registration on the OKX website
          • OKX API Key creation
          • Issuing a free license for OKX Data Provider
          • Setting up the OKX data provider in TSLab
          • OKX demo account
        • TSLab OKX Edition
          • First launch of TSLab OKEx Edition
          • Configuring the OKEx data provider
          • Trading in TSLab [OKEx]
          • OKEx Demo
    • Historical Data
      • YahooFinance
      • Offline data provider in CSV format
      • An example of connecting text quotes
      • Text files with historical data
    • Interactive Brokers
      • Getting Started with Interactive Brokers Data Provider
        • Installing and configuring the Trader Workstation (TWS) terminal
        • Installing and configuring the IB Gateway terminal
      • Features of working with Interactive Brokers data provider
      • Known issues for Interactive Brokers Data Provider
      • Loading instruments in a package
  • Working with the program
    • Main menu
      • File
        • Program Settings
      • View
        • Chart
          • Features of working with the Chart in TSLab
          • Chart Controls
        • Depth of Market
        • Quotes
        • All Trades
      • Data
        • Data Providers window
        • Add online data provider
        • Add offline data provider
      • Lab
        • Scripts window
          • Script Container
      • Trading
        • Accounts window
        • Positions window
        • My trades window
        • My orders window
          • Move orders and deals to an agent
        • Autotrading Control Center window
          • Agent window
          • Agent trading settings
            • Event recalculations
            • Slippage
          • "Forget errors" of the agent
        • Orders manager
          • Linking a manually completed order to an agent
        • Agent Control Center window
      • Tools
        • Data backup and recovery
        • Notifications manager
          • Notifications Manager Filters
          • Reference List of Service Message Numbers
          • Example of setting up notifications for Gmail
        • Export to Excel
    • Common interface
      • Status bar
      • Tab
      • Workspace
      • Spreadsheets
    • Visual editor
      • Toolbar
        • Compress and Decompress Blocks
      • List of visual blocks
        • Service Elements
        • Cycles
        • TSChannel
      • The syntax of the Formula, Boolean expression and String expression blocks.
    • Autotrading Control Center
      • Agent trade settings
        • Agent trade settings - Placing orders
        • Agent trading settings - Script execution
        • Agent trading settings - Events
    • TSLab API
      • API Introduction
        • Visual Studio Installation
        • First script (API)
        • First Indicator (API)
        • Script Debugging
        • Logging
      • Writing scripts on the API
        • Trading Instrument Data
        • Working with positions
        • List of deals
        • The order queue
        • Standard Indicators and Handlers
        • Script parameters
        • Caching
        • Local and global cache
        • Multiple Tools
      • Writing indicators on the API
        • Stream indicator
        • Bar indicator
        • Pre-processed indicator
        • Indicator with multiple calculations
      • Additional features
        • The ability to create your own optimizers *
        • C ++ / CLI script
        • API Control Panel
        • Result from script
        • * Оптимизация. Пул массивов.
      • Examples
        • Get script results
        • Get script parameters
        • Get script and agent settings
        • Get position balance (net worth)
        • An example of a strategy Breakout of the Donchian channel
        • Example of a Moving Average Crossover strategy
        • Indicator example
        • How to speed up the processing of a script on the API
        • Links to examples
      • Question - Answer
        • HandlerParameter Attribute
    • Optimization
      • Insufficient load on a multicore processor
  • Examples of scripts and indicators
    • Examples of algorithms and indicators
    • Examples of implementing strategies in TSLab
      • A trading system based on indicator CCI
      • A trading system based on Standard Deviation
      • A trading system based on Aroon
      • A trading system based on ADX and DI technical indicators
      • A trading system based on the RSI indicator
      • Example of a trading strategy without parameters
  • TSLab website
    • TSLab Support Service
      • Memory dump of TSLab application
      • TSLab program log files
Powered by GitBook
LogoLogo

Мы в соцсетях

  • Группа в Telegram
  • Новости TSLab
  • Vkontakte
  • YouTube канал TSLab Live

Наши веб-сайты

  • TSLab
  • Служба поддержки
On this page
  • Deribit PostOnly
  • Non-tradable Deribit futures
  • Buy/Sell blocks adapted for the Deribit exchange
  • Deribit Margin Requirements Calculation
  • Deribit order queue
  • Commission for testing and optimization on the Deribit exchange

Was this helpful?

Export as PDF
  1. Data providers
  2. Cryptocurrency exchanges
  3. Deribit Cryptocurrency Exchange

Deribit. Frequently asked questions and useful information

Last updated 2 years ago

Was this helpful?

Deribit PostOnly

PostOnly in the TSLab program is supported only with limit orders. It does not work with conditional orders and orders "by market"!

Examples for the visual editor:

  1. "Opening and Closing a position with a limit price"

  2. "Open a position if more/less" with the "Open by limit orders" flag set in the agent's trading settings (Agent's trading settings - the button with the image of a gear in the Agents window)

  3. "Closing a position by take-profit" with the "Take-profit without slippage" flag set in the agent's trading settings. (Agent's trading settings - the button with the image of a gear in the Agents window).

  4. The blocks corresponding to the first three "Convert By" items and their flags in the agent's trading settings (Agent's trading settings - the button with the image of a gear in the Agents window).

The type of the placed order can only be limit, for the PostOnly option to work in the TSLab program.

Non-tradable Deribit futures

The Deribit exchange has specific options, the underlying asset of which is a non-tradable futures individual for each series, which are not in the documentation. In the Deribit API, upon request for an option ticker, information about a non-tradable futures and its price is disclosed. The price of a non-tradable futures is calculated according to a formula similar to the rate of futures with expiration, depending on the variable "minutes to expiration". Unfortunately, it is impossible to implement access to the "Result Underlying Price" data for a specific option series, because there is no way to subscribe to these instruments when the program starts. They are broadcast only if you subscribe to one of the strikes where they are calculated. We have decided not to come up with any special mechanisms. You can calculate this value using linear interpolation:

Price_SYN = Price_Perpetual - (Price_Perpetual - Price_26JUN20) * (dT_SYN - 0) / (dT_26JUN20 - 0)

Buy/Sell blocks adapted for the Deribit exchange

Example of indicators implementation developed by one of our users:

ly0ka

SYN The underlying Deribit option futures price used to calculate theoretical prices and option Greeks.

Customized Buy/Sell options blocks:

Deribit Margin Requirements Calculation

Short call

Initial margin (BTC): Maximum (0.15 - Out of the Money Amount/Underlying MarkPrice, 0.1) + Mark Price of the option

Maintenance margin (BTC): 0.075 + mark price of the option

Short put

Initial margin (BTC): Maximum (Maximum (0.15 - Out of the Money Amount/Underlying MarkPrice, 0.1 )+ markprice_option, Maintenance Margin)

is there a way to calculate a simluation that would include the leverage? For Deribit you can set the initial deposit in BTC in a script

And use portfolio simulation with imitation type "Calculate changes"

Use Portfolio imitation with Calculate Changes imitation type.

Do the following in a script:

Initial deposit = 0.3btc

Use the "Constant" block as the initial deposit in the script. If the drawdown is greater than the initial deposit, then do not open new positions.

In open position we set lots per calculation leverage

script:

Deribit order queue

On the website of the Deribit exchange, the price step in the order queue is from $1 (can be changed up to $5). The queue depth is much greater than in TSLab.

  1. Why is the price step from 1 to 5$ on the exchange website, and every 0.5$ in TSLab? The step of futures at the exchange is $0.5, this is indicated in the contract specification.

Commission for testing and optimization on the Deribit exchange

For Deribit, use 0.05% or 0.075% Relative Fee and 0% Margin

Maintenance margin (BTC):Maximum (0.075, 0.075 * markprice_option) + mark_price_option Click this link to see calculation example -

Why is the queue depth on the exchange website much larger? We issue a queue of applications such as the exchange broadcasts from It can be compared with what comes from the getorderbook function on the stock exchange. If the exchange gives more, we will give the depth automatically.

https://docs.google.com/spreadsheets/d/1KQWOMF7Y5AE3SPJ_WLEcdVylysyJVZBP00-g_PbqURE/edit#gid=0
https://www.deribit.com/main#/account?scrollTo=api
10KB
Options_Deribit.zip
archive
31KB
Liquidation.tscript