API Support » Canceling Orders Oct 05, 2015 @ 10:59 AM (Total replies: 1) | |||||
Is there a way to cancel an order by order number or can you only cancel the last order? Thanks, Bryan Brayn Feddish |
|||||
API Support » Placing an order Sep 29, 2015 @ 09:49 AM (Total replies: 1) | |||||
I see your sample code for placing an order, i.e.: private static void PlaceOrder(OEC.API.Contract contract, OEC.Data.OrderSide orderSide, double limitPrice, string comments) but is there a way to create the contract within this function, i.e. one for MSFT or do I need to call the "SymbolLookup" then wait for a "oecClient1_OnSymbolLookupReceived" to get my contract value? Thanks, Bryan Brayn Feddish |
|||||
API Support » Getting Total Active Position on a Symbol Sep 15, 2015 @ 10:25 AM (Total replies: 1) | |||||
Is there a way to get a total active position on a symbol for a particular account or do I have to loop through the positions? Thanks, Bryan Brayn Feddish |
|||||
API Support » Using API in unmanaged C++ DLL. Aug 07, 2015 @ 02:50 PM (Total replies: 7) | |||||
The problem is, since I'm trying to do this inside a DLL I can successfully call the Connect() method from my c++ dll but in this DLL the oecapi_OnLoginFailed or oecapi_OnDisconnected never get triggered. // Interface declaration. public interface ICalculator { //int Add(int Number1, int Number2); string Connect(string www, int nID, string user, string pass, bool bVal, string strKey); string GetLastVal(string strVal); }; // Interface implementation. public class ManagedClass : ICalculator { //C:\CSP\Ment\TransLib\TransLib\bin\Debug>RegAsm.exe translib.dll /tlb:translib.tlb /codebase static OEC.API.OECClient oecapi = new OEC.API.OECClient(); static string strReturnValue = "Not Set"; public string Connect(string www, int nID, string user, string pass, bool bVal, string strKey) { string strRetVal = ""; try { oecapi.Connect(www, nID, user, pass, bVal); oecapi.OnLoginComplete += new OEC.API.OnLoginCompleteEvent(oecapi_OnLoginComplete); oecapi.OnLoginFailed += new OEC.API.OnLoginFailedEvent(oecapi_OnLoginFailed); oecapi.OnDisconnected += new OEC.API.OnDisconnectedEvent(oecapi_OnDisconnected); if (oecapi.CompleteConnected) { strRetVal = "Connected!"; } else { strReturnValue = "Failed Connect"; strRetVal = strReturnValue; } } catch (Exception ex1) { strRetVal = ex1.Message; } return strRetVal; } public string GetLastVal(string strVal) { return strReturnValue; } static void oecapi_OnLoginComplete() { strReturnValue = string.Format("{0}", oecapi.CompleteConnected); } static void oecapi_OnLoginFailed(OEC.Data.FailReason reason) { strReturnValue = string.Format("{0}", reason); } static void oecapi_OnDisconnected(bool unexpected) { strReturnValue = string.Format("{0}", unexpected ? "unexpected" : "expected"); } } Brayn Feddish |
|||||
API Support » Using API in unmanaged C++ DLL. Aug 07, 2015 @ 02:36 PM (Total replies: 7) | |||||
I don't see a DLL sample in there, just the C++ exe and Excel. Thanks Bryan Brayn Feddish |
|||||
API Support » Using API in unmanaged C++ DLL. Aug 07, 2015 @ 02:20 PM (Total replies: 7) | |||||
I have all these samples. I need to call the API from an unmanaged C++ DLL. The samples are all executables. Bryan Brayn Feddish |
|||||
API Support » Using API in unmanaged C++ DLL. Aug 07, 2015 @ 10:37 AM (Total replies: 7) | |||||
I have a client that has stock software written in some ancient development environment. I can’t remember the name. It can only call old unmanaged DLL’s and that’s it. A year or so I ago I wrote one in C++ VS2003 so he could communicate with a web service and it took a while but it worked. Now he wants to communicate with the OEC API. The best I could come up with so far was a C++ DLL that called a managed C# DLL that references the API.DLL but the problem is the API returns information, like login failed, etc. in events and those don't appear to be getting called, let alone the fact the C++ really just wants to call a function and get a value and be done with it. Any suggestions would be appreciated. Thanks, Bryan Brayn Feddish |