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.

Getting Indicator Problem
 Post subject: Getting Indicator Problem Post rating: 0   New post Posted: Wed 25 Apr, 2012, 05:15 
User avatar

User rating: 0
Joined: Wed 25 Apr, 2012, 04:59
Posts: 7
Location: TurkeyTurkey
Hello, I am new to JForex coding,
I hgave a problem, when i call indicator data it takes long time and throw exception..
Should i do something before using indicators or use indicators i a different usage?
Thanks much

Calling the indicator as like this
    try {
              ema_value = indicators.ema(instr, ema_period, OfferSide.BID, IIndicators.AppliedPrice.MEDIAN_PRICE, 14, 1);
        } catch (JFException ex) {
              Logger.getLogger(Trader_EURJPY_Long1.class.getName()).log(Level.SEVERE, null, ex);
        }

        try {
            natr_value_short = indicators.natr(instr, natr_short_period, OfferSide.BID, 14, 1);
        } catch (JFException ex) {
            Logger.getLogger(Trader_EURJPY_Long1.class.getName()).log(Level.SEVERE, null, ex);
        }

        try {
            cci_value_short = indicators.cci(instr, cci_short_period, OfferSide.BID, 14, 1);
        } catch (JFException ex) {
            Logger.getLogger(Trader_EURJPY_Long1.class.getName()).log(Level.SEVERE, null, ex);
        }


where
public Period natr_short_period = Period.TEN_SECS;
public Period cci_short_period = Period.TEN_SECS;
public Period ema_period = Period.FIVE_MINS;

and instr = Instrument.EURUSD;

Exception is :
com.dukascopy.api.JFException: com.dukascopy.charts.data.datacache.DataCacheException: Failed to load in-progress candle data in timeout period
        at com.dukascopy.api.impl.History.getBarsSecured(History.java:510)
        at com.dukascopy.api.impl.History$10.run(History.java:457)
        at com.dukascopy.api.impl.History$10.run(History.java:455)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.dukascopy.api.impl.History.getBars(History.java:455)
        at com.dukascopy.api.impl.Indicators.getInputData(Indicators.java:4911)
        at com.dukascopy.api.impl.Indicators.calculateIndicator(Indicators.java:4044)
        at com.dukascopy.api.impl.Indicators.calculateIndicator(Indicators.java:3965)
        at com.dukascopy.api.impl.Indicators.function(Indicators.java:3950)
        at com.dukascopy.api.impl.Indicators.ema(Indicators.java:1759)


 
 Post subject: Re: Getting Indicator Problem Post rating: 0   New post Posted: Thu 26 Apr, 2012, 11:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It appears as there has been a temporary data cache server problem. Does the problem persist?


 
 Post subject: Re: Getting Indicator Problem Post rating: 0   New post Posted: Fri 04 May, 2012, 11:28 
User avatar

User rating: 0
Joined: Wed 25 Apr, 2012, 04:59
Posts: 7
Location: TurkeyTurkey
There is a strange situation. When i log in from my real account
This problem does not appear. When i log in from Demo account problem
appears. What may be the problem?
Best regards


 
 Post subject: Re: Getting Indicator Problem Post rating: 0   New post Posted: Fri 04 May, 2012, 14:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
On which indicator do you get the exception? For more efficient assistance, could you please:
  1. provide an example strategy which replicates the case,
  2. provide a precise test case and JForex-API version,
  3. provide warning or error messages from Messages tab or Java Console, if any. If you launch the strategy from standalone, then please provide both the launching program and the logs.


 

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