开发者

Importing High/Low/Close Data into Excel (Trading/Futures "Coding") [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I want to import into Excel High/Low/Close data for, let's say, the Wheat contracts of 2009.

I'm looking to do this in Python, but I will learn another language if it is necessary.

I am a newb to programming for Futures. If the above problem is my goal, how can I achieve it?

P.S. I am not sure where or how to get the data in the first place. This may be a complex problem, so I am posting it in several Reddits/Forums. Any insight anyone can give would be greatly appreciated.

Regards, Sparrow


Progress Update: 2011-06-22 16:19

Response from EliteTrader.com user (kanellop):

The Major thing is...which is your Data Provider...? If i suppose that is Reuters DataLink...and you use Metastock... then you must use the Function: Convert of the Downloader and to transfer these Data's to Excel.

To answer his question, I use the ThinkorSwim platform. Data is received and organized by the platform into price charts such as this one.

Neither Reuters DataLink nor Metastock, which kanellop recommends, are free. Thus, it seems a little silly to have Think开发者_JAVA百科orSwim and then pay for a raw data feed. Shouldn't there be a way to rip the historical data from my platform?


In order to get the futures data you will need a trading API (such as the T4 API, btw T4 is free for 14 days) and if you're using C# then serializing the data to a CSV file is trivial.

It goes something like this:

using(StreamWriter sw = new StreamWriter("fileName.csv"))
{
    foreach(Quote q in quotes)// assuming there is a Quote object and a list of quotes
    {
        sw.WriteLine("{0},{1},{2},{3}", q.Open, q.High, q.Low, q.Close);// something of the sort
    }
}

The most difficult part you will encounter is using the trading API to pull the necessary data, but it comes with examples (which you will find in the install directory) so you should be able to figure it out in a couple of days or so.

Update:

What you're asking for is significantly more challenging then using a commercial API. It is possible and you have several options, but none of them are trivial:

  1. Scrape directly from the screen: make an application that takes screenshots and extracts the data from the images. Let's just say it's not fun!
  2. If it's a desktop application: you can intercept the network traffic that's coming into the application you're using and even if you're able to do that you may hit a big wall if they're utilizing a secure connection (i.e. encryption of some sort).
  3. If it's a web application: you can create a browser in C# and you can scrape the data from the HTML pages that your client gets... if they're using JavaScript, then this becomes SIGNIFICANTLY more complex!

At the end of the day, it will be MUCH cheaper if you just pay a 3rd party to give you the data then actually trying to develop software that "intercepts" the data from ThinkOrSwim.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜