API Support Forum
User Profile

Viewing User Profile for: SSokolov387


About

Jan 18, 2012 08:42 AM

Mar 23, 2015 06:06 AM

Mar 31, 2015 06:32 AM



Post Statistics
SSokolov387 has contributed to 9 posts out of 5677 total posts (0.16%) in 4693 days (0.00 posts per day).

20 most recent posts:

API Support » Multiple client connections Mar 23, 2015 @ 06:06 AM (Total replies: 4)

Hello,
Is is possible for single application to create multiple instances of OECClient and to connect them all to server under different user credentials?
The application is supposed to establish multiple simultaneous connections to OEC server, receive data through one of those connections and to execute transactions via all connections.
So the question is whether this kind of functionality (multiple OECClient from single app) is supported.

Sergey Sokolov

API Support » Another command is in execution. Feb 17, 2012 @ 07:39 AM (Total replies: 3)

That order was finally canceled, but now every order I submit is rejected with "Order breaks limits." comment and "Risk violation" error message which shows cash and credit balance "Max $16,242.50 | Used $25,000.00" even though I don't have any positions open.

Sergey Sokolov

API Support » Another command is in execution. Feb 16, 2012 @ 04:00 PM (Total replies: 3)

Hello,
I can't cancel or modify one of my orders sent through API during testing.
All cancel/modify commands failed with following error message: "Another command is in execution #202235577".
Order id is the same: 202235577. The order is in "working" state.
Do you know why this could be happening? Is this server problem?

Thanks.

Sergey Sokolov

API Support » Account expiration Feb 16, 2012 @ 10:57 AM (Total replies: 1)

Hello,
My API account is going to expire today. Could you please extend it?

Thanks.

Sergey Sokolov

API Support » Modify/cancel order before confirmation Feb 07, 2012 @ 04:36 PM (Total replies: 1)

During my testing I found that if I call OECClient.ModifyOrder() or OECClient.CancelOrder() before order was confirmed then Command (modify/cancel) is never executed. After order gets its confirmation from server, command just stays in Order.Commands list with negative ID and never executed.
Is it normal behavior or bug?

Sergey Sokolov

New Feature Requests » Remoting and custom ThreadingPolicy Feb 01, 2012 @ 02:26 PM (Total replies: 1)

Hello,
Currently, in API there is no way to use Remoting feature along with custom ThreadingPolicy because the only way to create API instance as Remoting client is to use CreateInstance(bool) method which rules out possibility to create instance with OECClient(ThreadingPolicy) constructor.
Could you please add CreateInstance(bool, ThreadingPolicy) method in next API version or some other method which would allow to use Remoting and custom Threading policy at the same time?

Sergey Sokolov

API Support » API blocks if remoting is on Jan 27, 2012 @ 09:26 AM (Total replies: 4)

Ok, does this mean that *synchronous* calls from event handler of remote applications (in my case Contracts["ESH2"]) are disallowed?

Sergey Sokolov

API Support » API blocks if remoting is on Jan 27, 2012 @ 09:11 AM (Total replies: 4)

Thanks for response.
As I understood, that means, in order to support Remoting (secondary), it is not enough just to create API instance as it described in http://www.openecry.com/api/OECAPIRemoting.pdf, but it is also necessary to make sure that application is not calling API from event handlers, is it correct?

Sergey Sokolov

API Support » API blocks if remoting is on Jan 27, 2012 @ 08:47 AM (Total replies: 4)

Hello,
I was working on Remoting feature support for my test and found following issue:
In some scenarios, when secondary application uses OECClient API from event callback, it may block both primary and secondary application.

Here is my scenario in details:

1. Primary application starts. It uses CreateInstance(true) but since this is first application, regular API instance is created. After that, primary application sets RemoteHostingEnabled to true.
2. After successful login, primary application calls to RequestContracts() from its OnLoginComplete handler
3. After application receives several OnContractsChanged() events, it discovers that Contracts["ESH2"] isn't null anymore and it calls to SubscribeTicks() from OnContractsChanged handler for this contract (ESH2)
4. After that, primary application starts to receive OnTicksReceived event calls.
5. Secondary application starts (actually, it's another instance of the same app with different parameters). It uses CreateInstance(true) and remoting instance is created.
6. Secondary app discovers that CompleteConnected is true so it does not call Connect()
7. Secondary app executes same RequestContracts() calls as in step 2
8. Same as in step 3, each time secondary app receives OnContractsChanged, it checks for Contracts["ESH2"]!=null.
But here is the problem: after secondary app receives FIRST OnContractsChanged event, it blocks on Contracts["ESH2"] call.
Moreover, primary app blocks at the same time and stops receiving OnTicksReceived events (and any other events since message loops in both apps are blocked)

I fixed the problem by using SynchronizationContext.Post() in event callbacks but it is not clear whether this is correct behavior of API

Is it expected behavior of API?
Is it allowed to use OECClient API from event callbacks? If it is not allowed in some cases only, is there any documentation with exact list of these cases?
Or is there any limitations to applications which use Remoting feature only?

Sergey Sokolov