|
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 |
Smackenn
|
Post subject: EMA Indicator strange error code only in live account |
Post rating: 0
|
Posted: Thu 27 Feb, 2014, 15:39
|
|
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?
|
|
|
|
 |
API Support
|
Post subject: Re: EMA Indicator strange error code only in live account |
Post rating: 0
|
Posted: Fri 28 Feb, 2014, 09:12
|
|
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.
|
|
|
|
 |
Smackenn
|
Post subject: Re: EMA Indicator strange error code only in live account |
Post rating: 0
|
Posted: Sun 02 Mar, 2014, 11:41
|
|
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
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|