Archive for the 'Finance' Category

N-Tick working

Finance| No Comments »

Got the N-Tick working. To get this operational we had to have the FinNode and the TickData a way to pass event data along side the finance data. We got that working, so he current state can display the n-tick time and value. The Event class is flexible enough to mix in different events of different types.

The next step is the Instaquote IPLink project. I got source files to build and run a windows app for connecting to Instaquote and getting financial data directly from them. I need a username/password from the Instaquote guys, so I’m waiting on that.

So next is to get the Expr node. The last thing I had to get working is to find a way to create spare parameters. The current method only allows for arrays of doubles. We want a gui to be able to specify any kind of spare parameter. To do this, we need to extend the types of passive gui elements under Composite.hpp. We need a Label only and a Text only.

New Laptop

Finance| No Comments »

Had to stop to do some overtime work. BUT, the overtime labor paid off, and I have a new laptop to do work remotely. VERY psyched about it. Overtime is over, holiday season is starting, but I’ll be able to sneak in work a LOT more often.

Where I last left off, I decided to stop doing the generalized expression node, and just to implement the n-tick algo that Chris suggested. Got that working VERY quickly, good. But it also allows me to focus on another hole in the API. I need to be able to define and pass on events to be eventually displayed.

Also, I realize that we need some support for navigating bwain using a laptop, multitouch interface. Modern window libraries most likely have support for multi-touch mouse pads, but the version of Qt I’m using is probably about 10 years old….

Also, NEED to find some free(cheap) online hosting for the source. Its the only sane way to share code between both computers….

Fin Expr Node

Finance| No Comments »

Very psyched about this. This is a great example for the expression language to make a profound impact. To make it work, need to implement some missing pieces:

  • Need a multi-line string input to define the expression. Actually, all I need is an array of strings, then have a new active gui widget to handle it.
  • Need some variables defined. All these variables have relative addressing
    • delta[int] - 1st order difference between current sample and last sample
    • sample[int] - tick data. This should be readable and writeable
    • time[int] - timestamp. This should be readable and writeable.
  • The timestamps are writeable, but shouldn’t be allowed to change the tick ordering. But how can you enforce that? Maybe provide a sorting operator or something? Still, no sense in constraining it, or detecting it.
  • Allow for any local variable to be automatically binded as non-varying inputs.
  • Have to improve the temp variable dialogue. Need to be able to define vector, vector, string, toggle (int), and menu (int).

If I can get this working, this will bullet-proof the shading language.

I forgot all the stuff involved with introducing a new Qt widget through the system. The multi-line edit is QTextEdit, have to subclass in guq first to bridge the signal-slot bullshit. Already got a text instanced. Since we’ll be coding, I have to allow for ‘return’ key to be pressed and keep the focus. ‘Shift-Return’ will remove the keyboard focus.

Got the QTextEdit working with the guq library. Next is making it an active parameter widget with the guqLink library.

Wow, got the widget instanced as a parameter. Have to work on getting it to play well with the application. Its not catching the up/down arrow events. Also, the Shift-Return is actually inserting a ‘return’. Then I have to get it to update the Array properly. But a lot of the hard part is done.

Ok, now I need a strategy for saving the multi line widget contents to an array of strings.

  • Once the user is done editing a line (Qt calls it a paragraph), we write the line to the string array
  • Ways to detect when a user is done editing a line are:
    • Hitting ‘return’. Return also inserts a new line, potentially splitting an existing line.
    • using up/down/left/right arrow to go to another line.
  • So optimally, we need a callback signal to tell when the user has finished editing a line. If the guq::TextEdit could handle this functionality, then that’s less work for a client to figure out.

Got this all working… Next up… more types of tmp variables. Should start with something minimal for the moment. But eventually, we should be allowed to specify any type of tmp variable type, and any type of gui to control it….. For now, just arrays of floats, ints, and strings will be enough.

FinViewer

Finance| No Comments »

Got the basic display mechanism working. Its very similar to the image processing model. The data is read in pieces, collected into a master buffer and displayed. I can properly display one array, and I’m trying to get the FinViewer to display multiple stacked arrays, each with their own view. That might be the most compact/accurate way to display multiple data sets since they have such varying ranges. I thought I could display them in one view, but that doesn’t work at all.

So the task is to detect for a condition, and flag it. Thinking about how I’m going to represent these ‘events’. Maybe just going to call it an ‘event’, and the data streams pass arrays of samples and events for display.

I’m happy that I’m going to get the shading language involved to make this happen.

Enough with the display. I can display multiple traces, display their values, edit their individual views, etc. I still can’t think of a solution for doing the tick marks in time. I need to find a ‘niceNum’ that works for years/months/days/hours/mins/secs.

Starting on the expression flag node.

Continued

Finance| No Comments »

Had to take time off to deal with some more immediate financial issues….

If I recall, I was starting to define how the data flow was going to behave w.r.t. the ScalarArray datatype. The whole setDirtyBit/cook order. I’m using the imgNode system as an example.

  • The source node has to be able to define its ScalarArrayBounds with a minimum of cooking.
  • This is passed down through the operators to the Buffer node, where it keeps a master list of the entire ScalarArray for display.
  • Any time a node has a parameter change, it calls Node::setDirty(), which triggers updates to all its output nodes downstream by calling setDirty() on them.
  • ImgNode::getBBox() is used to get the image bounds. FinNode::getBounds() is the equivalent.
  • ImgNode::fillTile() is used to calculate a piece of the image. FinNode::calcData() is the equivalent.

Got the Buffer class, and all the execution methods filled in.

Start on the Fin Viewer! Need to be able to see these samples. I know I shouldn’t go too crazy in implementing this. Just need the basics to be able to see these samples, scan across them, etc. I keep looking for examples of other financial software online…. Just tick marks I guess….

At the very least, I would need a way to make tickmarks. The values can be done with niceNum() (Graphics Gems I), but for time, I would need a niceNum() for financial time. Something that will handle years/months/days/hours/minutes/seconds.

Got the file to read in the data. Working on the display next.

There are 3 instances of a 2D gl view, one for the channel editor, one for the image viewer, and now a 3rd one for the fin viewer. I REALLY should create a GL 2D palette class. This would take/save views from a BBox, then subclass this for the the image viewer, and the fin viewer. I guess I have the time. I really don’t feel like re-writing all the get/save 2D view stuff….

Ok, maybe I don’t have to change the other two existing widgets. That would take a while. But for the FinView, I’ll start with the 2D canvas widget first, then have the FinView subclass off of that. I can look into using it for the other classes later. And I’ll have it available for future classes.


Scalar Array Buffer

Finance| No Comments »

I can’t (rather shouldn’t) call it CHOPS. Since what we’re doing is processing arrays of scalars, I’m calling the datatype, ScalarArray, and ScalarArrayIn. ScalarArray is for homogenous data, ScalarArrayIn is for inHomogenous data, and includes an extra array of timestamp data. This is what’s going to represent the tick data, but calling it ‘TickData’, would have been too restrictive.

I’m starting the Buffer class. I guess I should call it a ScalarArrayBuffer. Like the Image Buffer, it drives the interactivity and the data flow of the entire process. I’m starting with a simple file reader. But when we start looking at real-time feeds, this node will be instrumental in behaving as a queue, pulling in more data as it becomes available.

New Tech! Is always interesting.

Finance

Finance| No Comments »

Going to begin to write operators to read/process financial data. This link, points to some good raw data to start with.

Biggest issue so far, timestamps. I need a timestamp utility with usec granularity. The Boost stuff is all good, but it tries to be a bit too clever. I need time data that I can interpolate, use for calculations. The Boost stuff is too symbolic, as opposed to numerical.

gmtime seems to do the trick. I’m going to have to do some testing to see if I can initialize the structure and get the correct results. I’ll need that, plus another 16-bit short to count the milliseconds. The tick timestamps seem to have millisecond granularity. I think there are also methods for converting to different time zones, which could be very useful once we start dealing with exchanges in different time zones.

Looks like I already started a Time data type. It has the proper granulatiry, plus some numeric operators. If I can initialize it from an ascii date/time, I’m in business. ‘mktime’ is what I”m looking for….

I was able to get everything working by using the boost library stuff. I calculate the unix time myself, once I found the proper examples, the entire library fell into place. Timestamps are all good.

So I’ve added two new data types, ScalarArray, and ScalarArrayIn, for homogenous, and inHomogenous scalar arrays of data. The first two nodes will be a read operator, and a buffer type operator. Then a display node.

Got the timestamps fully working. Found a great reference here, that was very helpful in calibrating the timestamps, converting them from unix time, to boost::date_time, and back. Its solid now…


Copyright © 2010 Luna-Canis | Created by miloIIIIVII
Top | Sidebar | Sitemap | Disclaimer | Network