Search
× Search
Saturday, December 21, 2024

Archived Discussions

Recent member discussions

The Algorithmic Traders' Association prides itself on providing a forum for the publication and dissemination of its members' white papers, research, reflections, works in progress, and other contributions. Please Note that archive searches and some of our members' publications are reserved for members only, so please log in or sign up to gain the most from our members' contributions.

Guys!!! Whoever is using interactive Brokers’ API & C# Let me know. We can discuss the problems together and learn from each other.

photo

 Vlad H., Co Founder of www.ggfinances.com/

 Tuesday, April 7, 2015

Guys!!! Whoever is using interactive Brokers' API & C# Let me know. We can discuss the problems together and learn from each other.


Print

18 comments on article "Guys!!! Whoever is using interactive Brokers' API & C# Let me know. We can discuss the problems together and learn from each other. "

photo

 private private,

 Tuesday, April 7, 2015



I've been using this to download data and save to MS SQL database:


https://github.com/krs43/ib-csharp


Not an ideal integration as yet to do all I want with algo and backtesting etc. Once I figure this out....


The default C# example by IB I think might be a better choice. Just need to migrate across.


photo

 Nikolai P., Solutions for Encompass360: www.EncompDEV.com

 Tuesday, April 7, 2015



When I had to look at how to program IB for automated execution, I ended up using OpenQuant, and was lucky to buy it for only $900 right before they started requiring a subscription.

OpenQuant (as well as NinjaTrader) will allow you to write both backtesting and trading code in C# directly in their environment isolating lower level details of handling data feeds.

In case of OpenQuant, what I did was developed my own framework DLL. Then, OpenQuant could be configured to reference this DLL, and code can be debugged in Visual Studio during back testing, which is very convenient.

Somehow, as far as SQL Server goes, even though all the articles suggest limits of thousands of transactions per second, in practical applications, back in 2001 I saw limits of ~ 20 transactions per second making it impractical for tick data storage and currently one of my systems does ~ 500 select/inserts per second on a table with millions of records running on 4yo hardware with SSDs. Yet, it still seems a bit slow for tick data. Using files to store such data always worked well though.


photo

 Vlad H., Co Founder of www.ggfinances.com/

 Wednesday, April 8, 2015



Thanks for joining guys... Do you know any good source where I can learn how to test my model?

I have created my own algo trading app and I would like to make sure it is working 150%, before running on my real account.


photo

 Vlad H., Co Founder of www.ggfinances.com/

 Wednesday, April 8, 2015



Tristan, I am writing my algo trading app using C#. Here is a reference guide https://www.interactivebrokers.com/en/software/api/api.htm . Actually its not bad, so far everything is going fine. They give these virtual methods to manipulate everything. My app is working, only some minor bugs. Hope next week I will be up and running.


photo

 Greg Carleu, Automated Trading Systems Development at UFA LLC

 Wednesday, April 8, 2015



We use IB with Python and are very happy.


There are a lot of details to the IB API that can be difficult to get right. I have gotten a lot of use out of IBs demo apps, their tech support and a Yahoo group, http://groups.yahoo.com/group/TWSAPI.


As far as testing goes, IB will set up a paper trading account for you at no cost.


photo

 Nikolai P., Solutions for Encompass360: www.EncompDEV.com

 Wednesday, April 8, 2015



I would also highly recommend a paper trading account before real production use.

For a lot of algorithms, it's a much better alternative than back testing which may suffer from problems with "looking forward", "slippage" and "available price/volume". Essentially, paper trading will allow your algorithm to run with real tick data, plus submit orders and see if they execute or not based on same tick data. So if your algorithm is very "optimistic" such as finding minimums and submitting orders, there can be a "reality adjustment" via paper trading where you'll see that these spikes had very low volumes and never occurred after you placed your orders.

Before all these tools became popular, when I had to develop trading code in 2001, we had to design our own simulation framework which would account for all these issues by simply saving tick data together with prices & volumes. Then our framework would go through such ticks and make a determination whether orders would execute based on certain latencies and available prices & volumes. It was a lot more "realistic" and less "optimistic" than current back testing mechanisms based on bars.


photo

 Mikhail Sukhov, Founder of StockSharp (http://stocksharp.com)

 Wednesday, April 8, 2015



Hi guys.


We developing open source trading platform https://github.com/StockSharp/StockSharp/ . IB connector are included https://github.com/StockSharp/StockSharp/tree/master/Connectors/InteractiveBrokers Will be happy to any collaboration.


photo

 Vlad H., Co Founder of www.ggfinances.com/

 Thursday, April 9, 2015



NIkolai, I agree with you. Right now I am testing my model using IB paper trading. I fund a lot of thing that I would never guess. Without paper trading testing its like learning to swim in empty pool and then jump into the ocean loooool.


photo

 Nikolai P., Solutions for Encompass360: www.EncompDEV.com

 Thursday, April 9, 2015



Totally agree. What's rather funny in situations like these is observing all these people who don't know how to use the right tools making all sorts of funny claims like "I wrote a strategy, in back testing it brings 100% return, but in real trading it just lost 50%. I need to hire a developer who can fix errors with trading to make it match" :)


photo

 Greg Carleu, Automated Trading Systems Development at UFA LLC

 Friday, April 10, 2015



No testing is perfect. Backtesting suffers from overfitting the data, but gives a good idea of what the algorithm can do in the best possible conditions. Paper trading is very good for determining programming errors (and out of sample testing for the algo), but as you note it doesn't mirror order filling mechanics exactly.

In my opinion the best approach is to first backtest, then paper trade, then test it on a small account (where if it loses all the money you aren't out of business or fired). As you gain confidence increase the size of the account.


photo

 Richard Holowczak, Associate Professor / Director, Wasserman Trading Floor at Baruch College, CUNY

 Friday, April 10, 2015



For those just getting started with the Interactive Brokers TWS API, I humbly suggest my set of (introductory) tutorials: http://holowczak.com/ib-api-tutorials-by-programming-language/ These are what my students follow as they build their first algo trading systems.


photo

 Vlad H., Co Founder of www.ggfinances.com/

 Friday, April 10, 2015



Mikhail, I am testing on IB paper trading and it does let you set SMART routing system.


photo

 Greg Carleu, Automated Trading Systems Development at UFA LLC

 Friday, April 10, 2015



FYI - The issue is not the SMART routing system, but that IB's paper trading cannot mimic the order execution at the exchanges. It does not know whether or not your order will get executed, so it uses an inaccurate model. If you are hitting the bid or the ask (market order) it will be much more accurate.


photo

 Vlad H., Co Founder of www.ggfinances.com/

 Friday, April 10, 2015



Richard, I read your tutorials when I was starting. Great job man!!!! It was really useful.

Thank you.


photo

 Mikhail Sukhov, Founder of StockSharp (http://stocksharp.com)

 Sunday, April 12, 2015



Vlad, in paper trading SMART works not the same as in a real. In paper trading matching order will be inside IB instead of matching in other systems. That is major difference that gives absolutely different slippage.


photo

 Vlad H., Co Founder of www.ggfinances.com/

 Monday, April 13, 2015



Guys!!! I am trying to use RSI indicator in my algo. Is there any way I can get ready RSI from IB for my C# application? if not I guess I have to use real time bar charts to calculate it. Any tips?


photo

 Mikhail Sukhov, Founder of StockSharp (http://stocksharp.com)

 Wednesday, April 15, 2015



Vlad, there is a lot implementation of RSI. https://github.com/StockSharp/StockSharp/blob/master/Algo/Indicators/RelativeStrengthIndex.cs and many other from Google


photo

 Yair Altman, MATLAB expert consultant

 Friday, April 17, 2015



IB's API does not provide RSI or any other technical indicator data. You will need to compute it in your program using either asynchronous realtime bars callbacks, or timer callbacks to synchronous historical-data requests (be careful not to violate IB's pacing limitations here).

Please login or register to post comments.

TRADING FUTURES AND OPTIONS INVOLVES SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS
Terms Of UsePrivacy StatementCopyright 2018 Algorithmic Traders Association