API Support Forum
User Profile

Viewing User Profile for: YBar


About

Dec 01, 2008 12:46 PM

Oct 16, 2009 05:13 PM

Oct 16, 2009 05:13 PM



Post Statistics
YBar has contributed to 24 posts out of 5677 total posts (0.42%) in 5868 days (0.00 posts per day).

20 most recent posts:

Order Execution » switch from short to long in one operation Oct 16, 2009 @ 05:13 PM (Total replies: 4)

of course... thanks a lot for your quick help.

Order Execution » switch from short to long in one operation Oct 16, 2009 @ 04:53 PM (Total replies: 4)

Thanks SergeK, could you please send an example of how to do so?

YBar

Order Execution » switch from short to long in one operation Oct 16, 2009 @ 02:49 PM (Total replies: 4)

Hello,
I'm interested in implementing a switch from short to long (and vice versa) in one operation. is it doable using the API?
currently, i'm using the following code to send an order. Is it correct, or am I missing some steps?

//////////////////////////////////////////////////////////

d.Side = OEC.Data.OrderSide.Buy;
d.Quantity = 1;// (int)nQty.Value;
d.Contract = oecClient1.Contracts["ESZ9"];
d.Type = OEC.Data.OrderType.Market;
OEC.API.OrderParts res = d.GetInvalidParts();
if (res != OEC.API.OrderParts.None)
throw new Exception(string.Format("Invalid values in {0}", res));

OEC.API.Order order = oecClient1.SendOrder(d);
//////////////////////////////////////////////////////////


Best regards,
YBar

API Support » price is not updated Oct 01, 2009 @ 02:17 PM (Total replies: 17)

Hi SergeK,
I'm quite sure I didn't, but could you please give me an example of when could i've done so? does it appear on the example code? my application is mostly based on that example.

API Support » price is not updated Oct 01, 2009 @ 01:59 PM (Total replies: 17)

Guys, I'm realy lost here.

today, after 3 days it worked fine, at 8:17ET I lost connection again. The application received the onLoginComplete event, and then onContractsChanged event. But I didn't get the onPriceChanged event, so prices are not updated.

Do someone have an idea what else can I try?

Thanks

API Support » price is not updated Sep 28, 2009 @ 03:58 PM (Total replies: 17)

I also found out that the only contracts in the base contract list are 5 CCI-*** contracts, where are the other ones?

API Support » price is not updated Sep 28, 2009 @ 03:39 PM (Total replies: 17)

I tried using:
OEC.API.BaseContract bc = oecClient1.BaseContracts["ES"];
OEC.API.Contract tryc = bc.GetNearestContract();

untortunaly, bc == null, so now i'm quite loss, what else can I try?

Thanks

API Support » price is not updated Sep 28, 2009 @ 03:24 PM (Total replies: 17)

unfortunatly it didn't work, c is still null..
how can I get the contract again???

API Support » price is not updated Sep 28, 2009 @ 03:05 PM (Total replies: 17)

ok. so what i do is this:
the login event handler takes care of doing LoadContracts();
then i wait for the OnContractsChanged event, there i subscribe to my contract using this code:

OEC.API.Contract c = oecClient1.Contracts["ESZ9"];
if (c != null)
{
if (c.CurrentPrice == null)
oecClient1.Subscribe(c);
else
UpdatePrice(c);
}


does it look ok to you?

API Support » price is not updated Sep 28, 2009 @ 02:40 PM (Total replies: 17)

Hi again,
while debugging, I notice that in the piece of code mentinoed above c == null, which means that for some reason nothing in the combo-box is selected (although I can see the desired contract highlighted there!).
Is there a way to subscribe to my desired contract directly, without refering to the contract from the combo-box???

thanks!

API Support » price is not updated Sep 28, 2009 @ 08:51 AM (Total replies: 17)

ok, so what I did is place this code in the OnLoginComplete event handler:
//////////////////////////////////////////////////////////
OEC.API.Contract c = cbContract.SelectedItem as OEC.API.Contract;
myContract = c;
myContractWasSet = 1;
if (c != null)
{
if (c.CurrentPrice == null)
{
oecClient1.Subscribe(c);
}
else
{
UpdatePrice(c);
}
}
//////////////////////////////////////////////////////////

However, today at 6:46ET the price stopped updating. I would appreciate any suggestion on how to debug this.

Thanks!

API Support » price is not updated Sep 28, 2009 @ 08:34 AM (Total replies: 17)

Hi Guys,

I continue to debug this problem ( It happened again today at 6:46ET), looks like the login event is fired but I guess the subscription is not renewed, eventhough the contract is still there in the combo-box (in the GUI).
any suggestions?

Thanks!!

API Support » price is not updated Sep 24, 2009 @ 04:51 PM (Total replies: 17)

Hi,

It happened again today at 09:50:05 ET.
I would like to check Price.LastDateTime, but since the whole API is event based, I woudn't know under which event should I check it. Should I set some timer? which event would you suggest to place this check under?

Requested details:
server used:api.openecry.com , 9200
Login: YBar
Contracts: FDAX
Subscription type: I'm using the code sample (oecClient1.Subscribe(c);)


Your help is much appreciated!

API Support » price is not updated Sep 22, 2009 @ 03:06 PM (Total replies: 17)

Hello,
I've recently encountered a problem where the price is not updated anymore after some period of time the application (the sample one) runs.
If I restart the application the price is being updated again.
This happened to me in the last few days, and never happened before.
Is there a way to check when was the last time the price has changed?
If so, it should be done in some sort of event, right?

I appreciate your help on that,

YBar

API Support » an example for a console application (no GUI) Sep 22, 2009 @ 02:32 PM (Total replies: 3)

Thanks, but my question was regarding a CONSOLE application, w/o any GUI.
I'd appreciate it if someone could share a sample.

API Support » an example for a console application (no GUI) Sep 05, 2009 @ 08:29 AM (Total replies: 3)

Hello dear forum members,
I wonder if any of you kind members have an example for a simple console application that connects to the OEC server, subscribes to an EMINI contract, and calls a function each time a price changes. I know there are examples with GUI, but i need a very simple one.

Appreciate any help,

YBar

API Support » retrieving last trade time for FDAX contract Aug 20, 2009 @ 04:26 PM (Total replies: 1)

Hello,
i'm using the following method to retrieve the last trade time on the FDAX:
DateTime dt = Contract.CurrentPrice.LastDateTime;

however, i get the time with 2 hours shift from the CET. Is this the correct way to do it?

Best regards,
Ybar

API Support » quotes doesn't work in the API example code Dec 05, 2008 @ 07:44 AM (Total replies: 9)

Hi Andrey,
I didn't fully understand your description.
Are you also trying to run the advanced example with C#, and the Quotes control doesn't work for you?

API Support » quotes doesn't work in the API example code Dec 01, 2008 @ 12:50 PM (Total replies: 9)

Hello,

I'm running the advanced OEC API example. After successfull login, I try to subscribe to ESZ8 under the Quotes TAB, but without success.
However, when I subscribe to the same contract under the DOM area, I get the streaming data without problem.
what might cause this? is this a known issue in the API example code?

Thank you in advance,
YBar