HI I have MQ4 EA,I wang to convert to JFOREX,but I don't know hou to call these indicators function. 10 yeasr ago,I wrote EA call these function as: double m0=indicators.sma(insturment.EURUSD,Period.TEN_MIN,OfferSide.BID,IIndicators.AppliedPrice.MEDIAN_PRICE,period,0); double m1=indicators.sma(insturment.EURUSD,Period.TEN_MIN,OfferSide.BID,IIndicators.AppliedPrice.MEDIAN_PRICE,period,1);
It's easy to change from MQ4 to JFOREX. But I canot find these function ,I read the sample,it used as the follow(It's very difficut to undserstand): Object[] indicatorResult = indicators.calculateIndicator(selectedInstrument, Period.TEN_MINS, new OfferSide[] {OfferSide.BID}, "SMA", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[] {30}, 0); double m0 = (Double) indicatorResult[0]; indicatorResult = indicators.calculateIndicator(selectedInstrument, Period.TEN_MINS, new OfferSide[] {OfferSide.BID}, "SMA", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[] {30}, 1); double m1 = (Double) indicatorResult[0];
|