Skip to main content

Ruby Examples for BinaryOptionsTools

Example Ruby programs demonstrating the BinaryOptionsTools library with Async fiber support.

Prerequisitesโ€‹

  • Ruby 3.0+
  • BinaryOptionsTools Ruby gem
  • Async gem
gem install binaryoptionstoolsv2 async

Getting Your SSIDโ€‹

Visit PocketOption, open DevTools, find ssid cookie.

Running Examplesโ€‹

ruby basic.rb
ruby balance.rb

Examplesโ€‹

  • basic.rb - Initialize and get balance
  • balance.rb - Get account balance
  • buy.rb - Place buy trade
  • sell.rb - Place sell trade
  • check_win.rb - Check trade results
  • subscribe.rb - Subscribe to real-time data

Importantโ€‹

require 'async'
require 'binaryoptionstoolsv2'

Async do
client = BinaryOptionsToolsV2::PocketOption.init('your-ssid')
sleep 2 # Critical!

balance = client.balance
puts "Balance: $#{balance}"

client.shutdown
end

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.