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.

java.lang.NullPointerException in TesterMainGUIMode while backtesting when history.getBar(.) is called
 Post subject: java.lang.NullPointerException in TesterMainGUIMode while backtesting when history.getBar(.) is called Post rating: 0   New post Posted: Wed 30 Oct, 2013, 08:38 

User rating: 0
Joined: Mon 23 May, 2011, 13:03
Posts: 6
Location: Switzerland,
Dear Support

I tested my strategy with the TesterMainGUIMode and every time it produced the error java.lang.NullPointerException at the same point, when the day changes from monday to tuesday. The error is produced by the function history.getBars(instrument, period, OfferSide, 1) (see the pictures).

Another question I have is why does the name of day (Monday, Tuesday etc.) change at 22:30 but the date still stays right (see picture)?

Many thanks!

bigtrader

Image

Image

Image


Attachments:
File comment: specific_part_of_strategy
specific_part_of_strategy.png [24.4 KiB]
Downloaded 218 times
File comment: Console_Output_TesterMainGUIMode
Console_Output_TesterMainGUIMode.png [301.78 KiB]
Downloaded 239 times
File comment: DataLoadingRange_in_TesterMainGUIMode
DataLoadingRange_in_TesterMainGUIMode.png [26.68 KiB]
Downloaded 213 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: java.lang.NullPointerException in TesterMainGUIMode while backtesting when history.getBar(.) is called Post rating: 0   New post Posted: Wed 30 Oct, 2013, 08:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You have to properly initialize the array, e.g.:
IBar[] prevBar = new IBar[2];


 

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