Help writing a script

Discussion in 'OT Technology' started by trom, Jun 18, 2007.

  1. trom

    trom New Member

    Joined:
    Jun 2, 2004
    Messages:
    2,541
    Likes Received:
    0
    Location:
    Chicago, IL
    I work at a equity trading firm and need some help writing a script/small program to perform some pretty simple (I think) operations.

    A couple times each day NASDAQ releases data about order imbalances in certain stocks. For each stock there are two values I care about, which are two different price values for each individual stock (Data A and Data B, for simplicity).

    I'm looking to take these two values, find the difference between the two, and then output a list sorted by absolute value of the difference.

    Example:

    Stock XYZ
    Data A: $10.00
    Data B: $10.10


    Stock ABC
    Data A: $20.00
    Data B: $19.50

    Stock LMNO
    Data A: $100.00
    Data B: $100.05


    Pretending these are the only stocks in the world, I would want output like this:

    ABC .....(-.50)
    XYZ......(.10)
    LMNO....(.05)


    I have a little programming knowledge and could probably figure out the computational stuff, but I'm completely lost as to how to call the data from NASDAQ into the program.

    So my main question is this:

    What language should I attempt to write this in, and does anyone have any suggestions of where I can learn about how to integrate the streams of data into the script?

    I'm guessing there isn't enough info in this post for anyone to really work with, but I can try to find out more info if there's anything you can think of that would be helpful to know.

    Thanks! :x:
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    basically you'll need to either pay major bucks to get a true stock feed (which is likely worth the cost if you're looking to sell this or use if for business).

    The only free or very low cost solution would be to essentially screen-scrape the info from another site -- of possibly read an RSS feed. Either way, you're at the liberty of another company.

    www.hotscripts.com probably has the script you need to get the stock info. From there, it's easy to manipulate the data and display how you want it.
     
  3. trom

    trom New Member

    Joined:
    Jun 2, 2004
    Messages:
    2,541
    Likes Received:
    0
    Location:
    Chicago, IL
    Thanks for the reply.

    Getting the data isn't really a problem. My office has direct feeds to NASDAQ and receives data directly from NASDAQ. The software I use to trade on displays all the data I need instantly when it is released from NASDAQ. So, to my understanding, it's more of an issue understanding how to "use" the streams of data coming from NASDAQ in a script on the side.

    Could this be as simple as using a script in Excel? But again, I have no clue how to import the data into Excel.
     
  4. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    that answer will depend entirely on how the streems are delivered to determine how they can be manipulated.
     
  5. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    You could do something like this using really any language you want. What type of programming experience do you have? What format are you getting this data in, and how do you get it? You say they release the data a couple times a day so it's not really a "real-time" system, it might be a release every hour or every 30 minutes -- with something like that if there's a page you can load (from NASDAQ) that has the raw data you can really use *anything* to capture it.

    I'd personally use PHP for it cuz that's what I'm most familiar with. Any type of scripting language like PHP or Perl you'd set up a CRON/Scheduled Task to run it at whatever interval you need.

    With something like .NET or C++ you could probably write a program to grab the data without the need for an external scheduler or task but in essence it's really doing the same thing (as PHP/Perl).
     

Share This Page