|
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 |
MoneyMechanics
|
Post subject: CandleData vs. TesterHistoryGeneratedBar |
Post rating: 0
|
Posted: Thu 14 Mar, 2013, 20:23
|
|
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
|
|
|
|
 |
API Support
|
Post subject: Re: CandleData vs. TesterHistoryGeneratedBar |
Post rating: 0
|
Posted: Fri 15 Mar, 2013, 09:08
|
|
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.
|
|
|
|
 |
MoneyMechanics
|
Post subject: Re: CandleData vs. TesterHistoryGeneratedBar |
Post rating: 0
|
Posted: Fri 15 Mar, 2013, 14:46
|
|
User rating: 0
Joined: Thu 16 Jun, 2011, 21:37 Posts: 98 Location: SwitzerlandSwitzerland
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|