Skip to main content

Swift Examples for BinaryOptionsTools

Example Swift programs for iOS/macOS demonstrating UniFFI bindings usage.

Prerequisitesโ€‹

  • Xcode and Swift
  • UniFFI bindings
  • Native library

Getting Your SSIDโ€‹

Visit PocketOption, open DevTools, find ssid cookie.

Running Examplesโ€‹

Add files to your Xcode project and run, or use Swift Package Manager:

swift Basic.swift
swift Balance.swift

Examplesโ€‹

  • Basic.swift - Initialize and get balance
  • Balance.swift - Get account balance
  • Buy.swift - Place buy trade
  • Sell.swift - Place sell trade
  • CheckWin.swift - Check trade results
  • Subscribe.swift - Subscribe to real-time data

Importantโ€‹

Always wait 5 seconds after initialization:

let client = try await PocketOption(ssid: "your-session-id")
try await Task.sleep(nanoseconds: 5_000_000_000) // Critical!

SwiftUI Integrationโ€‹

See the Swift README in BinaryOptionsToolsUni/out/swift/ for SwiftUI examples.


Build strategies fasterโ€‹

  • โœจ ChipaEditor โ€” AI-powered algorithmic trading strategy builder: describe your edge, get a working CHTL strategy, backtest it on historical data, deploy it to a live broker. Free tier, browser and Android. (A trading platform โ€” not a general-purpose code editor.)
  • ๐Ÿ“ˆ ChipaX โ€” hybrid crypto exchange: perpetuals, spot and margin, with demo mode.
  • Chipa Ecosystem overview โ€” how these fit together with this library.