Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
Strategy for Specific UserName http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=83&t=51070 |
Page 1 of 1 |
Author: | hargun [ Mon 14 Apr, 2014, 05:17 ] |
Post subject: | Strategy for Specific UserName |
Hello. I am trying to make strategy that only run on specific username. I try this code : package jforex; But the strategy stops although User == account.getUserName(). Can anyone help me? Thank you |
Author: | API Support [ Mon 14 Apr, 2014, 07:19 ] |
Post subject: | Re: Strategy for Specific UserName |
Use equals method. |
Author: | hargun [ Mon 14 Apr, 2014, 08:28 ] |
Post subject: | Re: Strategy for Specific UserName |
API Support wrote: Use equals method. Thank you,Sir for your help. |
Author: | hargun [ Mon 14 Apr, 2014, 14:50 ] |
Post subject: | Re: Strategy for Specific UserName |
Dear Sir, I change : account.getUserName() == User to : account.getUserName().equals(User) I try to local run, there is no error message. But when I try in historical tester, it keeps showing an error message: java.lang.NullPointerException @ jforex.Tes2.onAccount(Tes2.java:37) Show full exception : java.lang.NullPointerException at jforex.Tes2.onAccount(Tes2.java:37) at com.dukascopy.dds2.greed.agent.strategy.tester.aq.GB(Unknown Source) at com.dukascopy.dds2.greed.agent.strategy.tester.aq.aR(Unknown Source) at com.dukascopy.dds2.greed.agent.strategy.tester.v.run(Unknown Source) at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source) at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.CI(Unknown Source) at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Cd(Unknown Source) at com.dukascopy.dds2.greed.actions.c.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) How to fix this error? Thank you |
Author: | API Support [ Tue 15 Apr, 2014, 13:21 ] |
Post subject: | Re: Strategy for Specific UserName |
tester does not know about your username, it only works while forward-testing, you can detect if it is Historical Tester by checking IEngine.getType(). See example here: https://www.dukascopy.com/wiki/#Account_Type,_Login,_Run_Mode |
Author: | hargun [ Fri 18 Apr, 2014, 03:54 ] |
Post subject: | Re: Strategy for Specific UserName |
Thank you, Sir |
Page 1 of 1 |