Coder Social home page Coder Social logo

stensoosaar / ibkit Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 7.0 1.41 MB

Interactive Brokers TWS/Gateway API in Swift

License: MIT License

Swift 100.00%
ib-gateway ibapi interactive-brokers interactivebrokers marketdata order-routing quantitative-trading streaming-data swift trading tws-api

ibkit's People

Contributors

stensoosaar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ibkit's Issues

How to use the API

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?

IBPriceBar failed to decode double

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"]

Outgoing message race between user requests and handshaking process

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_

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.