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.

CandleData vs. TesterHistoryGeneratedBar
 Post subject: CandleData vs. TesterHistoryGeneratedBar Post rating: 0   Post Posted: Thu 14 Mar, 2013, 20:23 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
Hi Support,

I am currently having a problem where I have a list of ITimedData objects and I then select one of interest and save it in an object I am using. As new onBar gets further calls with new bars (for the relevant instrument/period) I save them to the list mentioned. I periodically call a method which takes my saved ITimedData object and then searches for its index within the list.

When looking through the debugger I see that the ITimedData object is of type CandleData, but the same (in terms of high/low/open/close/volume) ITimedData object in the list is of type TesterHistoryGeneratedBar. Is there a way of comparing these two differing objects to see if they are the same using a method within the Duka API? If not can it be implemented?

Many thanks,
MM


 
 Post subject: Re: CandleData vs. TesterHistoryGeneratedBar Post rating: 0   Post Posted: Fri 15 Mar, 2013, 09:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Make a java.util.Comparator<ITimedData>, which would compare objects by their time. If you work with different feeds, then you will also need to check if the coupled IFeedDescriptors are equal.


 
 Post subject: Re: CandleData vs. TesterHistoryGeneratedBar Post rating: 0   Post Posted: Fri 15 Mar, 2013, 14:46 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
Many thanks!


 

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