API Support Forum
User Profile

Viewing User Profile for: DClark1295


About

Jan 16, 2014 10:13 AM

Mar 26, 2014 04:57 PM

Apr 05, 2014 04:59 PM



Post Statistics
DClark1295 has contributed to 15 posts out of 5593 total posts (0.27%) in 3757 days (0.00 posts per day).

20 most recent posts:

API Support » RequestBars for Day bars not working still ! Mar 26, 2014 @ 04:57 PM (Total replies: 10)

Victor,

Thank you ! I really appreciate your help. I was able to figure out what the issue was. You are the best !

Daniel Clark

API Support » RequestBars for Day bars not working still ! Mar 26, 2014 @ 03:40 PM (Total replies: 10)

Also, what do you mean your server is working as expected since I didnt get any bars I requested for Daily ?

I've tried commenting out all the SubscribeBars() calls and only leaving the RequestBars for Daily, but I still get the same exact result.

I would expect some bars to show up

Daniel Clark

API Support » RequestBars for Day bars not working still ! Mar 26, 2014 @ 03:25 PM (Total replies: 10)

Thanks for the reply !

I'm only checking if there is no bars currently and printing them out if they are present.

As soon as I start the app, I get this in on the screen:
13:27:18: oecapi_OnBarsReceived() No openEcry bars ; Updatable:True
13:27:18: oecapi_OnBarsReceived() No openEcry bars ; Updatable:False


Here is the code snippet:

static void oecapi_OnBarsReceived(OEC.API.Subscription subscription, OEC.API.Bar[] openecryBars)
{
if (openecryBars.Length < 1)
{
Console.WriteLine("oecapi_OnBarsReceived() No openEcry bars ; Updatable:{0}", subscription.Updatable);
return;
}

//code to print out bars here ....

}

Daniel Clark

API Support » RequestBars for Day bars not working still ! Mar 26, 2014 @ 02:33 PM (Total replies: 10)

Ok, I did that, but the log doesnt really tell me anything. There is only one instance of my program running. I even put in some code that creates a Mutex to prevent multiple instances.

Can you send me some RequestBars() code that you know works for Daily bars if you dont know ? I'm using the same code that works sometimes with Intraday.

Here is the log:

13:27:18.445 Dbg System #1 DClark1295 : Loaded, API: 90.0052ms, Client: 154.0088ms
13:27:18.830 Dbg System #1 1 ESM4: 267 Bars <Bars Items=[267] />
13:27:18.849 Dbg System #1 4 ESM4: 179 Bars <Bars Items=[179] />
13:27:18.903 Dbg System #1 2 ESM4: 69 Bars <Bars Items=[69] />
13:27:18.907 Dbg System #1 5 ESM4: 64 Bars <Bars Items=[64] />
13:27:18.908 Dbg System #1 5 ESM4: 0 Bars <Bars />
13:27:18.914 Dbg System #1 3 ESM4: 23 Bars <Bars Items=[23] />

Daniel Clark

API Support » RequestBars for Day bars not working still ! Mar 26, 2014 @ 01:58 PM (Total replies: 10)

I only have one application I use, so I dont see how there would be 2 connections.

Where is the log located ?

Thanks

Daniel Clark

API Support » RequestBars for Day bars not working still ! Mar 26, 2014 @ 12:00 PM (Total replies: 10)

I've looked at the OEC sample code, and I've used the same code thats worked before but RequestBars() only works sometimes. I cant get it to work for Daily. I've only gotten it to work for 15 min and 60min about 4 times total.

Can anyone confirm that they were able to get historical bars for Daily bars ?

Also, please post the code in C# to RequestBars if you have it working. I've worked with dozens of APIs over the last 10 years, and I've never had this many issues with something so simple. I'm just trying to get Daily bars from the last year up to now. I'm using ESM4 as the symbol

oecapi.RequestBars(contract,
OEC.API.Duration.Date(DateTime.UtcNow.AddDays(-89), DateTime.UtcNow),
OEC.API.BarDescription.Days(1)
);

Daniel Clark

API Support » SubscribeBars returning incorrect prices Mar 24, 2014 @ 03:40 PM (Total replies: 3)

Its the 1st bar. I will discard the 2nd bar.

Its been running great so far !

Daniel Clark

API Support » SubscribeBars returning incorrect prices Mar 24, 2014 @ 02:29 PM (Total replies: 3)

Thanks Victor.

Is the last bar always considered to be closing ? Should I just use the 1st bar ?

Seems like I should use the 1st one, but I will wait to hear from you.

Daniel Clark

API Support » SubscribeBars returning incorrect prices Mar 24, 2014 @ 02:19 PM (Total replies: 3)

So I've been noticing this odd behaviour for a few days. I subscribe to receive bars like this in my oecapi_OnSymbolLookupReceived() for ESM4

oecapi.SubscribeBars(contract, DateTime.UtcNow.AddDays(-3), OEC.Data.SubscriptionType.Bar, 15);

Then at some point after data is received for a 15 min bar, I get 2 bars. The log below is for a 15min bar for 2:15pm EST on 3/24/2014. I would expect only 1 bar, but I print out where it says "Raw bar info" whats in the OEC.API.Bar[] openecryBars passed in to the function oecapi_OnBarsReceived. The last bar in the OEC bars given to my program by OEC has the same low,hi,open price. These are obviously wrong , but I dont know why OEC is giving me these bad bars. The times are UTC, so thats why they say 6pm and 6:15pm.

I printed out exactly whats coming from OEC below, so I know its not my program. Please help ! I dont want to quit OEC, but I need this resolved !

12:59:57: [OpenECry] 2 bars received for Symbol[ESM4] Type[Bar] interval[15] Updatable[True]
12:59:57: [OpenECry] Raw bar info - date:3/24/2014 6:00:00 PM close:1849.5 low:1847 open:1848.25 hi:1849.75
12:59:57: [OpenECry] Raw bar info - date:3/24/2014 6:15:00 PM close:1849.5 low:1849.5 open:1849.5 hi:1849.5

Daniel Clark

API Support » RequestBars not working Mar 24, 2014 @ 02:08 PM (Total replies: 6)

I actually used DateTime.UtcNow.AddDays(-6), DateTime.UtcNow) when I was testing and it only worked sometimes. I've been using that for the last 2 weeks and I only get bars if I switch the interval and restart the program to request new bars.

I'm not sure why its this buggy. I really love the API but I dont think its my code when its working sometimes but not others.

Daniel Clark

API Support » RequestBars not working Mar 05, 2014 @ 11:21 PM (Total replies: 6)

I will try the OEC Sample. I dont have OEC Trader.

I use the username in my posts

Daniel Clark

API Support » RequestBars not working Mar 05, 2014 @ 08:35 PM (Total replies: 6)

Victor,

I can get historical bars if I change the interval to 15 instead of 5. Any idea why this doesnt work for 5 min bars ?

static void oecapi_OnLoginComplete()
{
OEC.API.Contract someES = oecapi.BaseContracts["ES"].Contracts.First;
if (someES != null)
DisplayContract(someES);
OEC.API.Contract ESU2 = oecapi.Contracts["ESH4"];
if (ESU2 != null)
DisplayContract(ESU2);

EsSymbolLookupRequest = oecapi.SymbolLookup("ESH4");
}

Daniel Clark

API Support » RequestBars not working Mar 05, 2014 @ 03:15 PM (Total replies: 6)

I used the code from the URL at [1] and other places on OpenECry but I can not get historical market data to show up. The event for oecapi_OnBarsReceived is called but the bars object is empty.

I've tried the code below with DateTime.UtcNow for both values , and it still doesnt work.

oecapi.RequestBars(contract,
OEC.API.Duration.Date( DateTime.Now.AddDays(-6), DateTime.Now),
OEC.API.BarDescription.HoursMinutes(5));

[1] http://www.openecry.com/api/api/html/4e2865e8-7ac9-457e-8d5a-6d930f3408a8.htm

Daniel Clark

API Support » Incorrect daily bar prices Feb 14, 2014 @ 12:17 PM (Total replies: 1)

I'm getting daily bar prices that are not the same as Interactive Brokers, TD Ameritrade, etc when I request historical daily bars. For example, I noticed the high prices for May 21, 2013 and May 22, 2013 are not the same as the other brokers I mentioned. Any thoughts ?

Am I doing something wrong in my API call below to cause the bad prices ?

DateTime dt = Convert.ToDateTime("12/31/2013 12:00:00 AM").ToUniversalTime();

oecapi.RequestBars(contract,
OEC.API.Duration.Date(dt.AddDays(-250), dt),
OEC.API.BarDescription.Days(1));

Daniel Clark

API Support » How to get historical data via API ? Jan 27, 2014 @ 02:23 PM (Total replies: 1)

How do I get historical data via the API ? I tried using the continous contract symbol @ES but that didnt work.

Help ?

Daniel Clark