Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
C++
MyLanguage
PINE Language
Blockly Visual Programming
Workflow
Key Security
Live Trading
Strategy Library
Docker
Deploy Docker
One-Click Docker Rental
Manual Deployment of Bot
Docker Operation Precautions
Global IP Address Specification
Command Line Parameters for Bot Program
Live Trading Data Migration
Docker Monitor
Exchange
Strategy Editor
Backtesting System
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes

Use the exchange.SetContractType() function to set option contracts. Different exchanges have different option contract code formats. FMZ Quant Trading Platform supports the following cryptocurrency options exchanges:

  • Futures_Deribit
    For Deribit exchange, simply call the exchange.SetContractType() function to set the option contract. After setting the option contract, when calling market data interfaces like GetTicker(), all retrieved data will be for that option contract.
    For order placement, use exchange.Sell() and exchange.Buy() functions. When placing orders, pay attention to the trading direction and use exchange.SetDirection() to set the trading direction.
    For order cancellation, use exchange.CancelOrder() function. To query positions, use exchange.GetPositions() function.

    Reference strategy code: Deribit Options Test Strategy
    Option contract code examples: BTC-13SEP24-60000-C, XRP_USDC-27SEP24-1-C, BTC-CS-6SEP24-57000_57500, BTC-PCAL-20SEP24_13SEP24-55000, etc.

  • Futures_OKX
    Setting contracts, placing orders, canceling orders, querying orders, and getting market data operations are the same as Deribit. The contract code format is BTC-USD-200626-4500-C.
    Contract-related information can be queried through the https://www.okx.com/api/v5/public/instruments interface.

    For example, to query BTC option contract information:

    javascript
    function main() { Log(HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD")) }
    python
    import json import urllib.request def main(): ret = json.loads(urllib.request.urlopen("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD").read().decode('utf-8')) Log(ret)
    c++
    void main() { Log(HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD")); }
  • Futures_HuobiDM
    Huobi option contract code example: BTC-USDT-201225-P-13000, representing a BTC contract with expiration date of December 25, 2020, option type PUT, and strike price of 13000 USD.
    Call options: Buyer pays premium in USDT, using USDT from account assets; seller's margin is in coin, using coin from assets as collateral.
    Put options: Buyer pays premium in USDT, using USDT from account assets; seller's margin is in USDT, using USDT from assets as collateral.

  • Futures_Bybit
    Supports Bybit exchange's USDC options. Set the trading pair to ETH_USDC and call the exchange.SetContractType() function to set the option contract.
    Option contract code example: ETH-25NOV22-1375-P.

  • Futures_Aevo
    Supports Aevo exchange's USDC options. Option contract code example: ETH-30JUN23-1600-C.

  • Futures_GateIO
    Supports GATE.IO exchange's USDT options. Option contract code example: BTC_USDT-20211130-65000-C.