striglia / stockfighter Goto Github PK
View Code? Open in Web Editor NEWstockfighter API wrapper
License: ISC License
stockfighter API wrapper
License: ISC License
The get started docs ought to mention you'll also need to pass in the api_key along with venue and account when initializing.
def place_new_order(self, stock, price, qty, direction, order_type):
"""Place an order for a stock.
https://starfighter.readme.io/docs/place-new-order
"""
url_fragment = 'venues/{venue}/stocks/{stock}/orders'.format(
venue=self.venue,
stock=stock,
)
data = {
"stock": stock,
"venue": self.venue,
"account": self.account,
"qty": qty,
"direction": direction,
"orderType": order_type,
}
hey,
So apparently trying to post something (ie. place_new_order) while using a dated version of requests causes the reponse to return:
TypeError: request() got an unexpected keyword argument 'json'
I believe the default version installed on some machines (mine being ububntu 14.04) is requests 2.2.1 which breaks when
return requests.post(_args, *_kwargs)
is called since this shortcut for the longer post statement is only supported on requests >2.4.2.
In order to avoid users having this issue, we should put in the documentation that users need to be on requests version >2.4.2 (can just be "do this - pip install requests --upgrade or you could add a line in requirements.txt "requests=2.4.2" and have people do "pip install -r requirements.txt" in the getting started section.
Not sure what would be the best way but wanted to report in what I have found.
See https://starfighter.readme.io/docs/quotes-ticker-tape-websocket for details.
People seem to have had luck w/ the ws4py library in python.
Some sharp edges to watch out for:
I have no idea how to effectively test any of this, since testing API keys aren't yet a real thing.
Right now I need to pull up the source in order to see the API calls. Should be closer to what stockfighter.io provides. If nobody else has claimed it I would be happy to write these, since I'll be using this extensively :)
See PR #14 which did this for the Stockfighter API.
Should clean up some setting of headers and be a negligible performance improvement.
Right now, pip install
still delivers a version of the library where terminating instances doesn't work. I know it is additional work, but if you recommend to use pip instead of just checking out the repo PyPI should be up to date.
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.