rterp / SumZeroTrading

A Java API for Developing Automated Trading Applications for the Equity, Futures, and Currency Markets
http://rterp.github.io/SumZeroTrading/
Other
145 stars 48 forks source link

How to use this API? #29

Closed danielhuang74 closed 7 years ago

danielhuang74 commented 8 years ago

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

rterp commented 8 years ago

You should start by running maven "mvn clean install" at the root level of the project, this will build all the sub projects, at which point all the imports should show up and the example classes should run. Let me know if you are still having troubles.

-Rob

danielhuang74 commented 8 years ago

I have run the maven command and it appears in Eclipse now. When I try to run the historical data example (HistoricalDataExample.java), there is an error: Exception in thread "main" com.sumzerotrading.data.SumZeroException: java.io.InvalidClassException: com.sumzerotrading.broker.order.TradeOrder; local class incompatible: stream classdesc serialVersionUID = -6534894073938597060, local class serialVersionUID = 2709729678604759892

rterp commented 8 years ago

Ok, there was a serialized order file that was checked into Git that shouldn't have been. Go ahead and run an git update on the example project, and try running the example again, although at this point on Friday I don't think you are going to be able to get historical data from TWS.