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.

EMA Indicator strange error code only in live account
 Post subject: EMA Indicator strange error code only in live account Post rating: 0   New post Posted: Thu 27 Feb, 2014, 15:39 
User avatar

User rating: 0
Joined: Mon 09 Jul, 2012, 14:09
Posts: 17
Location: Ireland,
Hi,

I am using:

double[] ema = indicators.ema(myInstrument, Period.ONE_HOUR, OfferSide.BID, AppliedPrice.CLOSE, emaPeriod8, Filter.ALL_FLATS, candlesBefore, currBarTime, candlesAfter);

In other words there is no "to" parameter in this version.

I get an error message that says:

14:00:00 com.dukascopy.api.JFException: "to" parameter can't be greater than time of the last formed bar for this instrument @ jforex.EMAwithParams.testCandleInterval(EMAwithParams.java:95)

Repeat, there is no "to" parameter in this version. This problem has never occurred in the Historical Tester, only in the Live account version of JForex.

Can you help?


 
 Post subject: Re: EMA Indicator strange error code only in live account Post rating: 0   New post Posted: Fri 28 Feb, 2014, 09:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Do you call the indicator on a subscribed instrument? Can you replicate the behaviour with a trivial strategy (the one which does nothing but calling the ema indicator). In such case please post the example strategy and the list of instruments that you have opened in the platform.


 
 Post subject: Re: EMA Indicator strange error code only in live account Post rating: 0   New post Posted: Sun 02 Mar, 2014, 11:41 
User avatar

User rating: 0
Joined: Mon 09 Jul, 2012, 14:09
Posts: 17
Location: Ireland,
Many thanks for coming back so fast. I have resolved the problem by replacing 0 with 1 as the Shift parameter in the line:

long currBarTime = history.getBar(myInstrument, Period.ONE_HOUR, OfferSide.BID, 1).getTime();

which was used to get the currBarTime parameter for the indicators.ema routine. This gives the last completed bar rather than the current bar. This works OK for my strategy and I can understand the logic of the indicators.ema routine rejecting a bar that is not yet fully formed, as a parameter.

Thanks again for your quick response.

SMcK


 

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