stensoosaar / ibkit Goto Github PK
View Code? Open in Web Editor NEWInteractive Brokers TWS/Gateway API in Swift
License: MIT License
Interactive Brokers TWS/Gateway API in Swift
License: MIT License
I am tryin to use IBKit. It looks great.
However, I don't even know how to initialize the API and start to use it.
Is there any document or could you provide more details about how to init the API and how to request historical price for a stock, for example?
I've tried to subscribe to ETH, using below method and utilising raw initialiser for your enums from values
marketData("ETH", interval: 5, secType: "CRYPTO", exchange: "PAXOS")
private func historicBarPublisher(
for contract: IBContract,
barSize size: IBBarSize = .minute,
duration: IBDuration = IBDuration.continuousUpdates(60, unit: .second)
) throws -> Int {
let requestID = client.nextRequestID
try client.requestPriceHistory(
requestID,
contract: contract,
barSize: size, // from raw time interval == 5
barSource: IBBarSource.trades,
lookback: duration // IBDuration.continuousUpdates(60, unit: .second)
)
return requestID
}
IBPriceBar
fails to decode double
Decoding error: cant unwrap double from , cursor: 5 ["90", "1", "-1", "20240425-06:50:40", "", "", "", "", "0", "-1"]
the connection locking logic, as there seems to be outgoing message race between user requests and handshaking process...
connecting: 127.0.0.1:4002
connected
1714051808.505105. ("API\0\0\0\0\tv142..175")
1714051808.5111098. ("\0\0\0G20\00\00\0ETH\0CRYPTO\0\00.00\0\00.00\0PAXOS\0\0USD\0\0\00\0\01 min\060 S\00\0TRADES\01\01\0\0")
connected to API
1714051808.526440. ("\0\0\0\n71\02\0999\0\0")
_Originally posted by @stensoosaar in https://github.com/stensoosaar/IBKit/pull/5#issuecomment-2077194162_
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.