Get values of indicators in jforex

Hello everybody,

today I want to write a few words about getting indicators values for testing strategy. 

Recently I had need to get ema value. But for my surprise following code didn't give me values, which I've seen on the screen:

double ema = indicators.ema(instrument, period, side, AppliedPrice.CLOSE, emaTimePeriod, 1);

And in order for getting proper indicator value I've found another fragment of code which gave me proper result:

double ema89 =, Period.TEN_MINS, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, 89, maType, indFilter, 1, prevBar.getTime(), 0)[0];

with following variables declared:

private static final IIndicators.MaType maType = IIndicators.MaType.EMA;
private static final Filter indFilter = Filter.ALL_FLATS;


  • Mark Smith said


    Thanks for posting this regarding Jforex EMA - I am very new to Java and dont understand what you have written above - is there any chance you could post/email the full code?

Add a Comment