Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

problem with getting many bars of history
 Post subject: problem with getting many bars of history Post rating: 0   New post Posted: Mon 22 Aug, 2011, 11:14 

User rating: -
Hi, I'm trying to get histroy data from Duka using Jforex API.
It looks like i can get very limited number of bars in history, less than 1000 (1minute).
it is possible to get more ?

i'll explain what i did
i'm using
java.util.List bars = history.getBars(Instrument.EURUSD, Period.ONE_MIN, OfferSide.ASK,Filter.WEEKENDS,60, (long)From,0 );

this command is showing i try to get 60 bars from "From" date.
when i try to get the latest 60 bars FROM NOW, i succesfully get them.
if i try to get 60 bars FROM a week before i get "Error while loading bars"
if i try to get 60 bars FROM 6 minutes ago, i get them.

what can i do to get more bars ? more history ?


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Tue 23 Aug, 2011, 07:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
okokok11 wrote:
what can i do to get more bars ? more history ?
Consider selecting a different period. It is advised to load smaller chunks of data, see an example here:
https://www.dukascopy.com/wiki/index.php ... _by_period

In case you are just trying to get historical bar data see:
viewtopic.php?f=65&t=25376&p=46856#p46856
You can also download the bar data in JForex Client Historical tester, by choosing Save Data.


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Tue 23 Aug, 2011, 15:59 

User rating: 0
Joined: Mon 22 Aug, 2011, 14:27
Posts: 4
Location: AU
using the client doesn't help me. i need to get large amount of bars using programming.
the message you gave link to, didn't make stuff more clear.
it talks about client.downloadData which send data to cache (which i cannot access, don't have the format of these fileS)...which doesn't help.
searching about it, i cannot find how to use it. let say i need 10000 bars of 1min, where downloaddata, is putting this ?


i simply need something like getbars, which will let me download large amounts of data.
getbars, allow me to get 800 bars of minutes, 800 bars of 15min, 800 of 30 min....
what if i want 10000 bars of 1 minute, without using the client ?
what can i do ?


examples would be appriciated
thanks


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Wed 24 Aug, 2011, 07:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
okokok11 wrote:
what if i want 10000 bars of 1 minute, without using the client ?
what can i do ?
Consider changing 10 to 10000 in the following example:
https://www.dukascopy.com/wiki/index.php ... igh_values
Mind that working with such amount of objects might cause OutOfMemoryException (this depends great deal on your heap size settings).


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Wed 24 Aug, 2011, 11:31 

User rating: 0
Joined: Mon 22 Aug, 2011, 14:27
Posts: 4
Location: AU
i get error while loading bars.
even if i try to get 60 bars, a week ago. get same error.
it looks like duka is accumulating in getbars, only up to 800 bars including the weekend.

question if its possible to program something as the client is doing, i don't care programing something that will save into the CSV file, as the client.
possible ?


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Wed 24 Aug, 2011, 12:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Could you please post the exception that you receive? Also please check if there is any exception on java console:
viewtopic.php?f=81&t=39073


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Wed 24 Aug, 2011, 20:13 

User rating: 0
Joined: Mon 22 Aug, 2011, 14:27
Posts: 4
Location: AU
well solved one error by using the history.getBarStart

whats happening now is, i can get 60 bars of any date BUT up to 1 july 2011
if i try 60 bars before 6/30/2011... i get error

com.dukascopy.api.JFException: Error while loading bars

the line i'm using is :

java.util.List bars = history.getBars(Instrument.EURUSD, Period.ONE_MIN, OfferSide.ASK, Filter.NO_FILTER, 60, (long)From, 0);


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Wed 24 Aug, 2011, 21:05 

User rating: 0
Joined: Mon 22 Aug, 2011, 14:27
Posts: 4
Location: AU
i wrote same code in java...(previous code was in C#)
suddenly its all working. no limits.
really strange, would really appriciate if you have some idea why its not working on C# (i wrote a whole trading code for duka using C#...without any problems)


 
 Post subject: Re: problem with getting many bars of history Post rating: 0   New post Posted: Thu 25 Aug, 2011, 07:26 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
okokok11 wrote:
really strange, would really appriciate if you have some idea why its not working on C#
Please refer to the common topic for JForex on .Net:
viewtopic.php?f=65&t=23971


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com