Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
Rust
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
Rust Strategy Development Guide
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 the options contract. The format of options contract codes varies across different exchanges. The cryptocurrency options exchanges supported by the FMZ Quant Trading Platform are as follows:

  • Futures_Deribit
    For the Deribit exchange, you only need to call the exchange.SetContractType() function to set the contract to an options contract. After setting the options contract, when you call market data interfaces such as GetTicker(), the data obtained will be the market data of that options contract.
    Use the exchange.Sell() and exchange.Buy() functions to place orders. Pay attention to the trade direction when placing orders; you can use the exchange.SetDirection() function to set the trade direction.
    Use the exchange.CancelOrder() function to cancel orders, and the exchange.GetPositions() function to query positions.

    Reference strategy code: Deribit Options Test Strategy
    Examples of options contract codes: 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, obtaining market data, and other operations are the same as with Deribit. The contract code format is BTC-USD-200626-4500-C.
    You can query contract-related information via the https://www.okx.com/api/v5/public/instruments interface.

    For example, to query the information of BTC options contracts:

    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)
    rust
    fn main() { let body: String = HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD", None); Log!(body); }
    c++
    void main() { Log(HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD")); }
  • Futures_HuobiDM
    Example of a Huobi options contract code: BTC-USDT-201225-P-13000, where the underlying asset is BTC, the exercise date is December 25, 2020, the option type is a put option (PUT), and the strike price is 13,000 USD.
    Call options: the premium paid by the buyer is in USDT, using the USDT in the account assets; the seller's margin is in coin, using the coin in the account assets as collateral.
    Put options: the premium paid by the buyer is in USDT, using the USDT in the account assets; the seller's margin is in USDT, using the USDT in the account assets as collateral.

  • Futures_Bybit
    Supports USDC options on the Bybit exchange. Set the trading pair to ETH_USDC and call the exchange.SetContractType() function to set the contract to an options contract.
    Example of an options contract code: ETH-25NOV22-1375-P.

  • Futures_Aevo
    Supports USDC options on the Aevo exchange. Example of an options contract code: ETH-30JUN23-1600-C.

  • Futures_GateIO
    Supports USDT options on the GATE.IO exchange. Example of an options contract code: BTC_USDT-20211130-65000-C