Visual Studio c++ API sample code

Which brokers have c++ API sample code that meets the following criteria?

1. Sample receiving live tick data
2. Sample retrieval bid ask (and hopefully level II as well)
3. Sample buy/sell
4. Sample GetCurrentPosition();
5. Sample GetCurrentOrders();
6. (optional - bonus points) MFC project file for VS 2013


Please provide links or private message me with information. Thank you.
 
why not make a DLL in your favourite programming language and connect it via whatever API the broker offers you? i did that in MT4 once. there is sample code too.
 
That sounds like a TON more work than what I'm talking about. With a well written API, I just need to call a function here and there to get the data/ send the orders.

What is your language of choice?

Quote from boskop:

why not make a DLL in your favourite programming language and connect it via whatever API the broker offers you? i did that in MT4 once. there is sample code too.
 
hmmm i thought that was rather simple. just like you want i think. call the DLL's function from MT4 to send or receive data.

the MT4 script would look something like this (pseudocode):

buyorsell = myfunctionfromdll(some_intdata, somemore_intdata, currentask, currentbid, anythingelse);

if (buyorsell == 0)
order_send( ...
else if (buyorsell == 1)
order_send( ..
else
...


i speak C/C++ best, so i wrote my DLL in that language.
 
Quote from bellman:

Which brokers have c++ API sample code that meets the following criteria?

1. Sample receiving live tick data
2. Sample retrieval bid ask (and hopefully level II as well)
3. Sample buy/sell
4. Sample GetCurrentPosition();
5. Sample GetCurrentOrders();
6. (optional - bonus points) MFC project file for VS 2013


Please provide links or private message me with information. Thank you.


Try XTRADER API or CQG API. Stop being blatantly lazy
 
Well, that is easy. Is this just as easy to do from the DLL?

bool myfunctionfromdll(some_intdata, somemore_intdata, currentask, currentbid, anythingelse) {
bool bs;
...

currentPos = myFunctionFromMT4();

...

return bs;

}


Quote from boskop:

hmmm i thought that was rather simple. just like you want i think. call the DLL's function from MT4 to send or receive data.

the MT4 script would look something like this (pseudocode):

buyorsell = myfunctionfromdll(some_intdata, somemore_intdata, currentask, currentbid, anythingelse);

if (buyorsell == 0)
order_send( ...
else if (buyorsell == 1)
order_send( ..
else
...


i speak C/C++ best, so i wrote my DLL in that language.
 
I don't see lazy as a negative. I am not an overall lazy person (quite the opposite). I've been down the road of writing a lot of code not directly related to the trading algorithm; I've learned to be as lazy as possible--there are only so many productive hours in the day.

Quote from Eyez:

Try XTRADER API or CQG API. Stop being blatantly lazy
 
Quote from bellman:

Well, that is easy. Is this just as easy to do from the DLL?

bool myfunctionfromdll(some_intdata, somemore_intdata, currentask, currentbid, anythingelse) {
bool bs;
...

currentPos = myFunctionFromMT4();

...

return bs;

}

that i don't know :) but there is a way if you want to know inside your DLL info about current orders etc. just send that information to the DLL by doing it this way:

in MT4:

myfunctionfromdll_senddataA(a);
myfunctionfromdll_senddataB(b);
...
myfunctionfromdll_processdata();
buyorsell = myfunctionfromdll_getwhat2do();
 
Well, that could work, and in the long run, that would not be much code to write.

I've always been hesitant to trade futures (and the MT4 platform in particular is not a good fit for me), otherwise, I would ask you to collaborate.

Quote from boskop:

that i don't know :) but there is a way if you want to know inside your DLL info about current orders etc. just send that information to the DLL by doing it this way:

in MT4:

myfunctionfromdll_senddataA(a);
myfunctionfromdll_senddataB(b);
...
myfunctionfromdll_processdata();
buyorsell = myfunctionfromdll_getwhat2do();
 
Back
Top