Code Monkey home page Code Monkey logo

interactive-brokers's People

Contributors

cmahon avatar ts468 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

interactive-brokers's Issues

status / direction of library

I noticed that Builder.hs only provides 2 functions, one for futures & one for market orders.

Is this library also geared to be used for stock securities, or will it simply only target forex & currencies?

The readme says it's a work in progress. Is there any plans to finish the library?

I am curious if i should implement my own library; it seems I'm interested in different features.

use Lazy ByteString for output of builder.

Another thing I would suggest is to use lazy bytestring for output of Builders. All builders produces lazy bytestring by default. And writing lazy bytestring maybe more efficient since it may uses vector writes. pipes-network 0.6.4 have lazy bytestring write support.

Parser suggestions

-- These are merely suggestions, I have not tested them

parseEmptyField :: Parser ()
parseEmptyField = char sepC *> return () -- no need to call (string "")

-- avoid (s == "") and read . eg:
parseIntField' :: Parser Int  -- shouldn't this be Parser (Maybe Int)?
parseIntField' = (parseEmptyField *> return 0) <|> parseIntField

-- avoid using String. eg:
parseMaybeEmpty :: Parser a -> Parser (Maybe a) 
-- This will NEVER fail, which is similar to your implementation. 
-- remove last "return Nothing" to allow it to fail.
parseMaybeEmpty parser = mconcat $
    [ (parseEmptyField *> return Nothing)
    , Just <$> parser
    , return Nothing
    ]

-- combine boolean parsers
parseBool :: Parser Bool
parseBool = mconcat $ parseField <$>
    [ char '1' <|> stringCI "true" *> return True
    , char '0' <|> stringCI "false" *> return False
    ]

Use Scientific to represent numerical value

Other than "why-not":

  1. "double" from attoparsec actually parse bytestring into Scientific, then converts it to Double.
  2. "scientific" from attoparsec internally handles sign/unsigned parsing, and it can represents signed/unsigned Integer and Floating point number. You can probably simplify a lot of parser.

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.