Retrieving Market Data For Automated Trading?

RichieC

Junior member
Messages
14
Likes
0
I recently realised my day trading could be completed automated, probably with much better results than I get at the moment since the computer could handle far more trades at once and would be free from the psychological side of trading.

My broker provides an API with functions for order handling but there appear to be no functions for the retrieval of market data. Presumably then I need a separate API to request market data, but despite endless searching I can’t find any information on the subject.

How would one normally go about retrieving market data for an automated trading application?

Also, are then any APIs that contain functions for the calculation of indicators such as moving averages? This would save a lot of time over having to write code to calculate all the indicators myself.

My model is fairly simple and it just uses a weighted combination of 13 factors to decide whether to enter a trade long, short or stay out. I just want to write a program to repeatedly evaluate the real time data from a set of high volume stocks against my model to assess whether they are offering a trading opportunity. It’s all fairly simple and if I had functions like double MovingAverage(string strTicker, int iPeriod) then it would be extremely easy to implement.

I must be searching for the wrong terms since I’m having no luck finding information on this subject so I’d be very grateful for any advice you can offer.

Thanks a lot for your help.
 
Depends entirely on the API you are looking at. What broker are you using? If your broker doesn't provide market data then you could look at something like MyTrack. Most api's do provide historical data though so I would be reasonably surprised if you don't have access to it. Likewise I would not expect most feeds to provide indicators as, as you say yourself, they are simple to calculate and would take up considerable bandwidth (given an almost limitless number of indicators available). Frankly if you can program an automated trading system that you have faith in then calculating indicators should be trivial.... :cool:

RichieC said:
I recently realised my day trading could be completed automated, probably with much better results than I get at the moment since the computer could handle far more trades at once and would be free from the psychological side of trading.

My broker provides an API with functions for order handling but there appear to be no functions for the retrieval of market data. Presumably then I need a separate API to request market data, but despite endless searching I can’t find any information on the subject.

How would one normally go about retrieving market data for an automated trading application?

Also, are then any APIs that contain functions for the calculation of indicators such as moving averages? This would save a lot of time over having to write code to calculate all the indicators myself.

My model is fairly simple and it just uses a weighted combination of 13 factors to decide whether to enter a trade long, short or stay out. I just want to write a program to repeatedly evaluate the real time data from a set of high volume stocks against my model to assess whether they are offering a trading opportunity. It’s all fairly simple and if I had functions like double MovingAverage(string strTicker, int iPeriod) then it would be extremely easy to implement.

I must be searching for the wrong terms since I’m having no luck finding information on this subject so I’d be very grateful for any advice you can offer.

Thanks a lot for your help.
 
Thanks for the reply. I’m with Genesis Securities (www.gndt.com). There’s a section on their website on automated trading as well as documentation for the APIs. If you look at the documentation all the functions are account related (logging in, placing orders, cancelling orders etc) and none are related to market data retrieval.

I had a look at the MyTrack SDK and, unlike Genesis, that does have all the functions required for requesting market data. I’ll bear them in mind but don't want to change broker at this time so I think I’ll investigate other ways of doing it first.

I suppose the most sensible thing to do would be to email Genesis and ask them where I’m supposed to get the market data from.
 
Thanks theknifemac, I never thought of that. Looks like it's only $99 with MyTrack which would be reasnoable. I'll see what Genesis say (it looks like they have a more advanced API that you have to request and that isn't on the website) and if not I'll look into an alternative data source and API.

I'll have a look around at other APIs as well but if anyone has any opinions on who offers the highest quality data source or best API I'd be very interested to hear.



Sorry for all the questions I don't know that much about trading or what services are available becuase I'm quite new to it. A while back resigned as a software engineer to give the markets a go under the impression day trading would be easy. I found the psychological side of things was what made it very difficult so decided to focus on producing a model for trading. After a few iterations I ended up with a model I’ve been testing for the last few weeks which would give me very good results.

So basically, if it sounds like I don’t know what I’m talking about when it comes to trading it’s because I don’t :) For that reason I’m very grateful for the advice you’ve offered.
 
You will need to look carefully at data feed reliability and accuracy when automating trading.
Many feeds were only designed to drive terminals and are not really up to the job. Data spikes can cost you a lot of money when trading is fully automated.

you might find some useful links in the directory of my website www.tradingmachines.net
 
Thanks a lot for that link. Looks like there’s a lot of good information which I’ll have a read through tomorrow.

I had been considering how best to filter out some of the wild trades that go through but if I can get a data source that does it that would be very convenient. I’ll definitely have to look at the options in the Data Sources section of the site.

Thanks again. I really have a lot better idea where I’m going with everyone’s help so I’m really grateful.
 
Thanks for the link to the math API. I’ll definitely make use of that, if not now in the future. I don’t directly consider candle stick formations in my current system but I may in a future system, so the functions for identifying formations would be very useful.

That thread on automated trading was also interesting to read and Vlad’s system is infinitely more complex than mine, which leaves me feeling a bit insecure and wondering if I’ve just been lucky so far. I keep waiting for things to fail catastrophically but it just keeps giving me an average daily profit that I would be extremely happy with.

I’ll continue testing the system while I write the code and as long as it continues working then I won’t have much reason not to use it.
 
Top