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.

NPE in thread "FirstTickOnWeekends"
 Post subject: NPE in thread "FirstTickOnWeekends" Post rating: 0   New post Posted: Mon 14 Mar, 2011, 23:39 

User rating: 0
Joined: Sun 20 Feb, 2011, 12:46
Posts: 1
When i'm running my own strategy (started from main()), during weekends I
get the following error:

Exception in thread "FirstTickOnWeekends" java.lang.NullPointerException
at com.dukascopy.api.impl.connect.JForexTaskManager.a(Unknown Source)
at com.dukascopy.api.impl.connect.DCClientImpl.a(Unknown Source)
at com.dukascopy.api.impl.connect.l.run(Unknown Source)

How can I avoid this error so my program starts?


 
 Post subject: Re: JFOREX-2864 NPE in thread "FirstTickOnWeekends" Post rating: 0   New post Posted: Thu 27 Oct, 2011, 08:16 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
"When i'm running my own strategy (started from main()), during weekends I
get the following error: "

Do you try to launch it on weekends?
On weekends, we have no ticks and there is no trading at all, that is why this exception rises.


 
 Post subject: Re: JFOREX-2864 NPE in thread "FirstTickOnWeekends" Post rating: 0   New post Posted: Sun 06 Nov, 2011, 18:39 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
API Support wrote:
"When i'm running my own strategy (started from main()), during weekends I
get the following error: "

Do you try to launch it on weekends?
On weekends, we have no ticks and there is no trading at all, that is why this exception rises.


So, should I start my strategy exactly at the time when market opens?

And why ISystemListener().onDisconnect() isn't called in this case?

I'm trying to find the way to run my strategy around the clock.


 
 Post subject: Re: NPE in thread "FirstTickOnWeekends" Post rating: 0   New post Posted: Mon 07 Nov, 2011, 09:18 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
trottel wrote:
So, should I start my strategy exactly at the time when market opens?
To be more precise - over weekends there are no ticks and bars that arrive are flat (O = H = L = C = 0 and Volume = 0) and your orders will be rejected on submission. It is unknown what assumptions were made by the user that he received an NPE, normally you should be able to run/back-test your strategy over weekends. If you want to trade over particular periods, see the following example: https://www.dukascopy.com/wiki/index.php ... ding_hours


 
 Post subject: Re: NPE in thread "FirstTickOnWeekends" Post rating: 0   New post Posted: Sun 08 Apr, 2012, 21:54 
User avatar

User rating: 0
Joined: Mon 09 Jan, 2012, 20:51
Posts: 9
Location: Luxembourg, Wormeldange
Can that exception in FirstTickOnWeekends be safely ignored?

I would like to start my strategy earlier on Sunday and then just leave it ready for the market to open. Is that possible?


 
 Post subject: Re: NPE in thread "FirstTickOnWeekends" Post rating: 0   New post Posted: Wed 11 Apr, 2012, 09:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It can not be "ignored" since the exception prevents the strategy from starting when the market is closed. Consider calling IClient.startStrategy right when the market opens.


 

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