Pulling data from an API of your choosing (C++)

biggus_dickus

Newbie
Messages
2
Likes
0
Hey,
How you would go about pulling data and displaying it in a dialog box using an API (whichever one you're familiar with) ? I understand that this might be somewhat redundant since the platform already does it for you, however I'm currently trying to understand a specific API (Takion) and was hoping to get an idea of how this is done in any other API. More specificity as to the coding is always encouraged

Any help is greatly appreciated

Thanks
 
There will be api document that outlines the methods and parameters those methods require. There may or may not be a section in the documentation that shows the format of the payload. Typically this is Json but xml is also used by some APIs. Once you have that you can code up how you might use the data in whatever application or processing you require.
 
Hey,
How you would go about pulling data and displaying it in a dialog box using an API (whichever one you're familiar with) ? I understand that this might be somewhat redundant since the platform already does it for you, however I'm currently trying to understand a specific API (Takion) and was hoping to get an idea of how this is done in any other API. More specificity as to the coding is always encouraged

Any help is greatly appreciated

Thanks

I am a self taught programmer and it's very unlikely that the data will be JSON or XML as these are normally information delivered by request. If you want to retrieve price information you don't want to keep making requests to see if price has changed. Instead you need the API to trigger an event when there is a change/update.

I wrote my own bespoke trading app in C# which is similar to C++ and more than likely you will need to subscribe to an EVENT like a price changed event.

The documentation of your API will describe a Price Class and the various members of that class and their type.

Eg/ Price might be of type double, Volume of type integer

This article may help and a good place to start: http://docs.microsoft.com/en-gb/cpp/cpp/event-handling?view=vs-2017
 
Looks like new_trader is right. The documentation states it uses the observer pattern which basically abstracts the payload and provides you with strongly typed objects with methods and events. I am not a fan of this model and having worked on many APIs with market data, it is definitely not geared towards data consumption in a standard sense but rather an algo focused api with speed in mind. C++ is also an ugly language.
 
Looks like new_trader is right. The documentation states it uses the observer pattern which basically abstracts the payload and provides you with strongly typed objects with methods and events. I am not a fan of this model and having worked on many APIs with market data, it is definitely not geared towards data consumption in a standard sense but rather an algo focused api with speed in mind. C++ is also an ugly language.

C++ is a fine language with low-level access to the hardware in a convenient high level language.

There are essentially only two types of API access you can have. Either events are done for you or the data is passed to you for you to create your own events.
 
C++ is a fine language with low-level access to the hardware in a convenient high level language.

There are essentially only two types of API access you can have. Either events are done for you or the data is passed to you for you to create your own events.

It is a good language for speed and low level. I can code in java, c#, Scala, python, vb, and some others but I can say that c++ isn't by any means an elegant language
 
It is a good language for speed and low level. I can code in java, c#, Scala, python, vb, and some others but I can say that c++ isn't by any means an elegant language

If you're coding in all these languages then you're probably not very good. Jack of all trades kind of hack.

The elegance is in the actual programs you are writing not the language itself silly.
 
Top