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.

Strategy stops unexpectedly
 Post subject: Strategy stops unexpectedly Post rating: 0   New post Posted: Tue 27 Mar, 2012, 12:16 

User rating: 1
Joined: Tue 31 Jan, 2012, 06:11
Posts: 7
Location: CanadaCanada
Hi Dukascopy teem
My strategy runs well on the local machine. However when I run it on remote server (DEMO account) the strategy stops and throws the following massage on the java console:

menu.item.forex.calculator=/marketwatch/forexcalc/forex_calculator/, debug=false, client.mode=DEMO, loginId=376298, get.help.url=https://www.dukascopy.com/swiss/english/forex/jforex/forum/, menu.item.interest.rates.calendar=/marketwatch/calendars/InterestRatesCalendar/, wlabel.foUrl=https://demo-login.dukascopy.com, history.server.url=https://www.dukascopy.com/datafeed/, external_ip=70.24.180.100, wlabel.longLabel=Dukascopy Bank SA, services1.url=https://demo-login.dukascopy.com, wlabel.skype=dukascopy, wlabel.phone=+41 (0) 22 799 4888}]
27.03.2012 06:57:07.099 SEVERE tree.e ] Unsupported type : class com.dukascopy.api.Instrument
27.03.2012 06:57:07.100 SEVERE tree.e ] Unsupported type : class com.dukascopy.api.OfferSide
27.03.2012 06:57:07.101 SEVERE tree.e ] Unsupported type : class com.dukascopy.api.IIndicators$AppliedPrice
27.03.2012 06:59:40.038 SEVERE tab.StrategiesContentPane ] STATE RECEIVED: TERMINATED

Please can you help with that.
Thank you
Nikolay


 
 Post subject: Re: Strategy stops unexpectedly Post rating: 0   New post Posted: Tue 27 Mar, 2012, 13:10 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
ERROR 2012-03-27 10:59:15,164 [Strategy NikBBandsStopRemote] StrategyProcess - Strategy error :
com.dukascopy.api.JFException: Indicator file doesn't exists @ jforex.strategies.indicators.NikBBandsStopRemote.onStart(NikBBandsStopRemote.java:100)
at com.dukascopy.api.impl.Indicators.registerCustomIndicatorSecured(Indicators.java:5247)

You are trying to register a custom indicator. It does not exist on a remote server.


 
 Post subject: Re: Strategy stops unexpectedly Post rating: 0   New post Posted: Tue 27 Mar, 2012, 13:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Mind that the server can't access your file system, therefore, on server you can register an indicator only by passing the class, i.e. using the following method:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IIndicators.html#registerCustomIndicator(java.lang.Class)
See the example:
https://www.dukascopy.com/wiki/#Use_cust ... _indicator


 
 Post subject: Re: Strategy stops unexpectedly Post rating: 0   New post Posted: Wed 28 Mar, 2012, 04:30 

User rating: 1
Joined: Tue 31 Jan, 2012, 06:11
Posts: 7
Location: CanadaCanada
Hi Dukascopy
I registered the indicator as required:

…….
public void onStart(IContext context) throws JFException {
this.engine = context.getEngine();
this.console = context.getConsole();
this.history = context.getHistory();
this.context = context;
this.indicators = context.getIndicators();
this.userInterface = context.getUserInterface();
indicators.registerCustomIndicator(new File("/Users/nikolay/JForex/Strategies/files/BBandsStopIndicator.jfx"));
}
…….
However the strategy still stops.
Here is the message thrown in java console:

27.03.2012 23:22:40.266 SEVERE tree.e ] Unsupported type : class com.dukascopy.api.Instrument
27.03.2012 23:22:40.278 SEVERE tree.e ] Unsupported type : class com.dukascopy.api.OfferSide
27.03.2012 23:22:40.279 SEVERE tree.e ] Unsupported type : class com.dukascopy.api.IIndicators$AppliedPrice
27.03.2012 23:23:03.263 SEVERE tab.StrategiesContentPane ] STATE RECEIVED: TERMINATED



Thank you
Nikolay


 
 Post subject: Re: Strategy stops unexpectedly Post rating: 0   New post Posted: Wed 28 Mar, 2012, 08:21 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can only use the following method:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IIndicators.html#registerCustomIndicator(java.lang.Class)
and not:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IIndicators.html#registerCustomIndicator(java.io.File)
Hence, the following approach:
    //register custom indicator defined inside a strategy
    indicators.registerCustomIndicator(Indicator.class);
and not:
    //register custom indicator located in ...\JForex\Strategies\files folder
    indicators.registerCustomIndicator(new File(context.getFilesDir() + System.getProperty("file.separator") + "Indicator.jfx"));


 

Jump to:  

cron
  © 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