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?
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.
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; }
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.
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.