|
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.
Strategy Error |
Terry
|
Post subject: Strategy Error |
Post rating: 0
|
Posted: Wed 19 Sep, 2012, 22:19
|
|
User rating: 0
Joined: Mon 02 Apr, 2012, 09:22 Posts: 12 Location: United Kingdom, London
|
The attached strategy shows the following error when run : java.lang.NullPointerException @ jforex.Strategy_2.onTick(Strategy_2.java:205) Although, there is no error when it is compiled. Please tell me what should I do to remove this error. Thanks. 
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 07:27
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
We could not replicate the issue, please provide a precise launch scenario and full stack trace.
|
|
|
|
 |
Terry
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 09:39
|
|
User rating: 0
Joined: Mon 02 Apr, 2012, 09:22 Posts: 12 Location: United Kingdom, London
|
I am sorry I meant that the strategy shows the above-mentioned error when back-tested in the historical tester. I have attached the results of the strategy. Kindly check them.
Attachments: |
Strategy_2 Results.pdf [229.14 KiB]
Downloaded 300 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.
|
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 10:44
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please also provide the Historical Tester settings - you can also take a print-screen.
|
|
|
|
 |
Terry
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 11:36
|
|
User rating: 0
Joined: Mon 02 Apr, 2012, 09:22 Posts: 12 Location: United Kingdom, London
|
Here are the historical tester settings that you asked for.
Attachments: |
Historical Tester Settings.png [28.93 KiB]
Downloaded 449 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.
|
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 13:24
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please check the full stack trace to find where the problem is: java.lang.NullPointerException at jforex.requests.Strategy_2$Strategy_2_RiskAmount.closeOrder(Strategy_2.java:323) at jforex.requests.Strategy_2$Strategy_2_RiskAmount.onTick(Strategy_2.java:289) at jforex.requests.Strategy_2.onTick(Strategy_2.java:205) at com.dukascopy.dds2.greed.agent.strategy.tester.AbstractStrategyRunner.historicalTickReceived(AbstractStrategyRunner.java:634) at com.dukascopy.dds2.greed.agent.strategy.tester.StrategyRunner.run(StrategyRunner.java:469) at com.dukascopy.dds2.greed.agent.strategy.tester.AbstractStrategyRunner.startSynched(AbstractStrategyRunner.java:566) at com.dukascopy.dds2.greed.actions.StrategyTesterAction.startTest(StrategyTesterAction.java:992) at com.dukascopy.dds2.greed.actions.StrategyTesterAction.doAction(StrategyTesterAction.java:264) at com.dukascopy.dds2.greed.actions.ActionExecution.run(ActionExecution.java:47) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
That is, you call method on the order before checking if is null or not.
|
|
|
|
 |
Terry
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 14:22
|
|
User rating: 0
Joined: Mon 02 Apr, 2012, 09:22 Posts: 12 Location: United Kingdom, London
|
Could you please modify the strategy to make it work? I can't seem to figure it out.
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Error |
Post rating: 0
|
Posted: Thu 20 Sep, 2012, 14:28
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
You simply need to flip the lines 323 and 324.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|