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 47 forks source link

add a CFDTicker class and member variable defaultProperty in Ticker #31

Open aries1998 opened 7 years ago

aries1998 commented 7 years ago

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 .

rterp commented 7 years ago

Thanks @aries1998, I understand the new tick type, but what is the new defaultProperty in the Ticker class? Could you attach a code snippet, and I can get it integrated into the library?

thanks, -Rob

aries1998 commented 7 years ago

defaultProperty is IHistoricalDataProvider.ShowProperty.xxxxx normally we use IHistoricalDataProvider.ShowProperty.TRADES, but for forex , cfd or maybe other types of instruments , we can only use IHistoricalDataProvider.ShowProperty.BID for the data

rterp commented 7 years ago

ah, ok. I'll try to get this integrated this week.

rterp commented 7 years ago

Initial support for a CFDTicker has been added. I've written unit tests, but have not actually tested yet with IB's API in the demo or paper trade account.