API Support Forum
User Profile

Viewing User Profile for: VVadim41


About

Mar 22, 2010 07:27 AM

Aug 18, 2010 05:29 PM

Nov 26, 2010 07:11 AM



Post Statistics
VVadim41 has contributed to 12 posts out of 5677 total posts (0.21%) in 5393 days (0.00 posts per day).

20 most recent posts:

API Support » OECClient in other thread Aug 18, 2010 @ 05:29 PM (Total replies: 6)

very strange method.
Are there any other way, more elegant?

API Support » OECClient in other thread Aug 18, 2010 @ 02:07 PM (Total replies: 6)

Hello.
I'm writing my programm and I want to add OECClient in other thread.
I trying to do something like code on bottom, but callbacks not works...
I try use waitHandle.WaitOne and this not works too...
Can you help me with idea?
ps on Main thread all works good of caurse...


public void Thread9()
{
try
{
myDelegate = new AddListItem(AddListItemMethod);
myDelegate2 = new AddLabel(AddLabelMethod);
t9.Name = "Thread9";
if (client == null)
{
client = new OECClient();

client.OnLoginComplete += new OnLoginCompleteEvent(client_OnLoginComplete);
client.OnLoginFailed += new OnLoginFailedEvent(client_OnLoginFailed);
client.OnDisconnected += new OnDisconnectedEvent(client_OnDisconnected);
client.OnError += new OnErrorEvent(client_OnError);
client.OnContractsChanged += new OnContractsChangedEvent(client_OnContractsChanged);
client.OnTicksReceived += new OnTicksReceivedEvent(client_OnTicksReceived);
client.OnDOMChanged += new OnDOMChangedEvent(client_OnDOMChanged);
}

Run9();
}
catch (Exception ex)
{
SaveLog(t9.Name, ex.Message.ToString(), "");
}
}




public void Run9()
{
while (!m_stop9)
{
try
{
if (!OEC_isconnected)
{
client.Connect(host, port, username, password, true);
//Thread.Sleep(100);
}
//other code will be here
//waitHandle.WaitOne();
}
catch (System.Runtime.InteropServices.COMException e)
{
SaveLog(t9.Name, e.Message.ToString(), e.ErrorCode.ToString() + " " + GetError(e.ErrorCode));
}
catch (System.Exception e)
{
SaveLog(t9.Name, e.Message.ToString(), e.Source.ToString());
}
}
}


//callbacks
public void client_OnLoginComplete()
{
// waitHandle.Set();
SaveLog(Thread.CurrentThread.Name, "", "Client connected");
OEC_isconnected = true;
LoadContracts();
}


API Support » Unsubscribing request fail Jun 04, 2010 @ 01:02 PM (Total replies: 2)

ok, thx

API Support » Unsubscribing request fail Jun 04, 2010 @ 10:00 AM (Total replies: 2)

Hello.
Few days ago I see a problem with unsubscribing instruments.
I have Tick and Dom subscription and when I send request to unsubscribe this, Tick is not unsubscribed...
Result of request and subscription list on my log:
04.06.2010 17:51:17 FDAXM0Dom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
NSEA-MN0 DOM
ESM0 Tick
ESM0 DOM
EUR/USD Tick
EUR/USD DOM
04.06.2010 17:51:17 FDAXM0Dom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
NSEA-MN0 DOM
ESM0 Tick
ESM0 DOM
EUR/USD Tick
EUR/USD DOM
04.06.2010 17:51:17 NSEA-MN0Dom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
ESM0 Tick
ESM0 DOM
EUR/USD Tick
EUR/USD DOM
04.06.2010 17:51:17 NSEA-MN0Dom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
ESM0 Tick
ESM0 DOM
EUR/USD Tick
EUR/USD DOM
04.06.2010 17:51:17 ESM0Dom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
ESM0 Tick
EUR/USD Tick
EUR/USD DOM
04.06.2010 17:51:17 ESM0Dom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
ESM0 Tick
EUR/USD Tick
EUR/USD DOM
04.06.2010 17:51:17 EUR/USDDom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
ESM0 Tick
EUR/USD Tick
04.06.2010 17:51:17 EUR/USDDom Unsubscribed, Tick unsubscribing FAIL
FDAXM0 Tick
NSEA-MN0 Tick
ESM0 Tick
EUR/USD Tick


and request code:

try
{
bool error1 = false;
bool error2 = false;
client.Unsubscribe(contract);
foreach (Subscription subscription in client.Subscriptions)
{
if (subscription.Contract.Symbol == instrument.Symbol && subscription.Type == SubscriptionType.Tick)
error1 = true;
}
client.UnsubscribeDOM(contract);
foreach (Subscription subscription in client.Subscriptions)
{
if (subscription.Contract.Symbol == instrument.Symbol && subscription.Type == SubscriptionType.DOM)
error2 = true;
}
if (!error1 && !error2) Console.WriteLine(Clock.Now + " " + instrument.Symbol + "Tick&Dom Unsubscribed");
else if (!error1 && error2) Console.WriteLine(Clock.Now + " " + instrument.Symbol + "Tick Unsubscribed, DOM unsubscribing FAIL" );
else if (error1 && !error2) Console.WriteLine(Clock.Now + " " + instrument.Symbol + "Dom Unsubscribed, Tick unsubscribing FAIL");
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}

Edited by VVadim41 on Jun 4, 2010 at 10:05:47

API Support » RequestTicks May 15, 2010 @ 04:13 AM (Total replies: 4)

Ok, thx for support

API Support » RequestTicks May 14, 2010 @ 05:10 PM (Total replies: 4)

As you see on my sreenshot SubscribtionList filling FDAXM0 contact infinitely...
And not unsubscribe automatically

API Support » RequestTicks May 14, 2010 @ 09:42 AM (Total replies: 4)

Hello.
I use RequestTicks method for history data and when all data received I try to unsubscribe this contract. Result failed with out errors and client.Subscriptions.count raised for each new request...
Sreenshot here http://img442.imageshack.us/img442/6648/ticks.png
How can I resolve it?

API Support » reconnection May 07, 2010 @ 04:44 PM (Total replies: 12)

login: APetrosyan
Edited by VVadim41 on May 7, 2010 at 16:45:20

API Support » reconnection May 07, 2010 @ 04:29 PM (Total replies: 12)

I use api v3.4 and sim. server.
OpenQuant application with with updated oec sample provider.
Screen todays data:
http://img708.imageshack.us/img708/56/datah.jpg
There was not disconnect events on log when all data freezed.
I subscribe ESM0,FDAXM0,NSEA-MM0 and EUR/USD.
On 07.05.2010 22:34:02(GMT +3) subscribe event started and my time event force resubscribe contracts.
Edited by VVadim41 on May 7, 2010 at 16:33:42

API Support » reconnection May 07, 2010 @ 02:41 PM (Total replies: 12)

I have another problem with updating data. Today connection with server was not lost but data freeze again. What you advise to check status?

API Support » reconnection May 07, 2010 @ 02:21 PM (Total replies: 12)

yes, I use this.
I decided problem by adding event control (contract changing) + force subscribe contracts after timeout...

API Support » reconnection May 05, 2010 @ 03:20 PM (Total replies: 12)

Hello.
I saw that after reconnect to server subscribed data is freezing. "OEClient.contract = null" errors and I think it need some time for loading contracts.
If I subsribe new contract for other freezing, new contract update correctly and other still not update
How can I check this?
Edited by VVadim41 on May 6, 2010 at 04:26:49
Edited by VVadim41 on May 6, 2010 at 04:30:29