rterp / sumzerotrading Goto Github PK
View Code? Open in Web Editor NEWA Java API for Developing Automated Trading Applications for the Equity, Futures, and Currency Markets
Home Page: http://rterp.github.io/SumZeroTrading/
License: Other
A Java API for Developing Automated Trading Applications for the Equity, Futures, and Currency Markets
Home Page: http://rterp.github.io/SumZeroTrading/
License: Other
When TWS is closed the EReader.run() method throws a java.io.EOFException, and the trading program stops execution. When TWS is restarted, the trading program must be restarted in order to reconnect to TWS. Update the Interactive Brokers classes to automatically reconnect to TWS when it is online again.
Ability to configure and run trading strategies from a UI rather than the command line.
1 add cfdTick : cfd is quite popular is ib today
2 add member variable defaultProperty in Ticker : will be more convenient cause some ticker type like cfd can only require bid/ask data , no trades data.
i have made this change of my local pc. Becasue Ticker and ShowProperty are in different package , add dependency of differnt package will make it ugly so i didn't make a pull request. Hope you can tweak it nicely.
And thanks for your great work .
It appears that if an API application places an order, and then TWS and the API app are shut down and started again, and then the order is filled, the API application does not receive an order status event for the order. Find out how to get order events that were placed during previous API sessions.
Set up release builds to bintray and maven central for project.
Create a fluent API for ticker symbols so that they can be configured with less code.
ie
FuturesTicker ticker = new FuturesTicker("CL").setExpiryMonth(3).setExpiryYear(12).setCurrency("USD")
Set up code coverage metrics for project.
order.type is set to MKT in the property file, but the strategy is still submitting orders as MOC.
I have noticed that there are some threads running after calling the InteractiveBrokersClientInterface.unsubscribeLevel1() method as well as
InteractiveBrokersClientInterface.disconnect(). Are there any methods which can be used to close the running threads after the connect() method and subscribeLevel1() method?
There are no status return for InteractiveBrokersClientInterface.connect() method. I have noticed that sometime it will fail to connect the IB. In this case, it is good to have this connect() method to return the status.
Hi,
I would like to test out your API but could not find the properties files(e.g. intraday.props...) in your repository. Would you mind attach it here?
Besides, I have noticed it is required to set the StrategyDirectory. How is the format of the strategy file stored in this directory?
Many thanks.
Best Regards,
Vincent Yap
Properly handle error message from IB:
Quote engine error: id='43' errorCode='162' message='Historical Market Data Service error message:HMDS query returned no data: GOOGL@SMART Trades'
Currently the call to request the historical data will continue to block as it doesn't recognize this is an error condition. The call should throw an exception back to the caller, and the caller can decide if they want to query for the historical data again.
Create a Paper broker which will accept and execute trades in a sandbox environment, and record results to a local filesystem or database.
java.lang.NullPointerException
at com.sumzerotrading.broker.ib.InteractiveBrokersBroker.getDirName(InteractiveBrokersBroker.java:444)
at com.sumzerotrading.broker.ib.InteractiveBrokersBroker.createDir(InteractiveBrokersBroker.java:437)
at com.sumzerotrading.broker.ib.InteractiveBrokersBroker.loadOrderMaps(InteractiveBrokersBroker.java:425)
at com.sumzerotrading.broker.ib.InteractiveBrokersBroker.(InteractiveBrokersBroker.java:117)
at com.sumzerotrading.interactive.brokers.client.InteractiveBrokersClient.(InteractiveBrokersClient.java:80)
at com.sumzerotrading.interactive.brokers.client.InteractiveBrokersClient.getInstance(InteractiveBrokersClient.java:65)
at com.sumzerotrading.ib.example.trading.TradingExampleWithOrderStatusListener.placeFuturesOrder(TradingExampleWithOrderStatusListener.java:51)
at com.sumzerotrading.ib.example.trading.TradingExampleWithOrderStatusListener.main(TradingExampleWithOrderStatusListener.java:115)
Provide the ability to run a trading strategy as a server-side application within Wildfly or Glassfish.
Add support for CFE, needed for Vix futures.
Add commissions to the TradeOrder object after the order has completely filled.
It appears IB Order Events are modifying ticker objects which is causing anything that uses ticker.equals() to return false after an order event is fired, when before the order event the equals() method would have returned true.
Ability to get a market data snapshot as described on p. 47 of the "Getting Started with the TWS Java API" guide.
Perhaps adding additional Map of Level1qoute and listeners to QuoteEngine to handle market data snapshots (MDS) to keep MDS listeners separate from subscriptions, so that when tickSnapshotEnd() is called an MDS listener is removed but subscription one is kept.
Hi,
I have previously used the IB API by itself but am now looking to switch to this one. How do I run the example files? I have just downloaded all the files. Is there some sort of preparation I need to do beforehand? Currently, I am using Eclipse and it is not finding any of the imports from the SumZeroTrading API.
Thanks
Fix unit tests for the intraday trading strategy
Running mvn clean install
leads to the error:
[ERROR] Failed to execute goal on project collective2-broker-api-impl: Could not resolve dependencies for project com.sumzerotrading:collective2-broker-api-impl:jar:1.0.0-SNAPSHOT: Could not find artifact com.sumzerotrading:J4C2:jar:1.0.0-SNAPSHOT -> [Help 1]
The ShortStartTime property is not properly being read from the property file.
After an order is placed for a ticker the real-time bar builder will return the same OHLC data from the time the order is placed. It appears the Level1QuoteListener stops receiving events for that Ticker after an order for that Ticker is executed.
Currently when a market data subscription to Interactive Brokers is created, but IB can't find the information, an error is returned saying that a security definition for the request can't be found. However the ticker symbol isn't returned so it isn't clear which subscription request failed if multiple are submitted at once.
i'm trying to get open positions from ib with getOpenPositions but find out that it only returns an empty array from InteractiveBrokersBroker.getAllPositions() .
Then in EClientSocket.reqPositions() method , it just do nothing but print some version numbers. I'm a liitle confused how to do it .
Add a static method to the IBConnectionRegistry that allows mock objects to be set for the IBConnectionInfo to IBSocket map for unit testing purposes.
Ability to trade the intraday strategy in a long-only mode, using a standard ETF for the long position, and a Long inverse ETF to create a synthetic short position.
It appears that the serialVersionUID variable is not getting properly set for the TradeOrder class or one of the classes that it relies upon.
Ensure all classes include:
private static final long serialVersionUID = 1L;
com.sumzerotrading.data.SumZeroException: java.io.InvalidClassException: com.sumzerotrading.broker.order.TradeOrder; local class incompatible: stream classdesc serialVersionUID = -6534894073938597060, local class serialVersionUID = 2709729678604759892
Add support for requesting market data and placing trades for stock/futures options with Interactive Brokers.
Failed with the message:
Could not resolve dependencies for project com.sumzerotrading:sumzero-ib-common-api:jar:0.1.7-SNAPSHOT: Failure to find com.ib:interactive-brokers-api:jar:9.73 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Apparently maven only has https://repo.maven.apache.org/maven2/com/interactivebrokers/tws/tws-api/9.72.05/
Hi,
Is there a way to specify the account number before starting the trading via the API?
:)Vincent Yap
Currently, there is no wait period for the user to click the "Accept Connection" button when the example App connects to TWS. In order for the app to work, connections from localhost must be accepted by TWS automatically.
Update the library so it will block up to 30 seconds before throwing a connection exception back.
The EOD trading example is not writing any info from the classes in its library to its log file. Log statements from the InteractiveBrokersBroker are making it into the log file however.
Request all positions from TWS that were opened by the API application
Give the Intraday strategy the ability to trade Futures contracts.
proje : Adding a Custom JavaFX Component to Scene Builder 2.0 (Part 2).
proje için Style.java içeriğini paylaşabilir misiniz?
veya
projeyi github'ta paylaşabilir misiniz?
com.sumzerotrading.marketdata.QuoteEngine stores listeners in Lists. When subscribing to Level1 and Level2 quotes and reusing the same listener, it could be added more than once to the List, and would receive the same quote multiple times.
Using a Set would solve this problem.
Ability for the intraday system to monitor the stats of one ticker, but then place the actual trade on a different ticker symbol.
Add support for the following futures exchanges:
Singapore: SGX
Osaka: OSK.JPY
Hong Kong: HKFE
Hi,
I have tried to modify the TradingExampleWithOrderStatusListener.java by adding the Level1QuoteListener. After running it, the quotes can be received until placing the order. Although I have added the sleep code, the quote listener will stop after placing the order.
Attached the modified code and also the log file for your investigation.
Give me some hints on how to continue receiving the quotes after placing the order.
Thank you.
Best Regards,
Vincent Yap
TradingExampleWithOrderStatusListener_java.txt
tradingexamplelog.txt
The follow error is being throw back from IB when attempting to subscribe to market data for GLD and GDX.
2016-04-07 09:55:46 ERROR InteractiveBrokersBroker:263 - BrokerError: ID:100003 errorCode:200 errorMessage: The contract description specified for GDX is ambiguous.
2016-04-07 09:55:46 ERROR InteractiveBrokersBroker:263 - BrokerError: ID:100004 errorCode:200 errorMessage: The contract description specified for GLD is ambiguous.
serialVersionUID is not working properly in the Commodity class because it isn't final.
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.