To use chat, please login.
Back to contacts

jForex Strategy: Indicator with multiple price inputs

Nov 30 2012 at 04:29
247 posts
I’m coding an EA for jForex that’s using multiple prices for the indicator Input. It took me a while to figure out how to get the indicator values correctly for the Strategy. I was following the samples & documentation and came up with following code:

Object[] resultArr = indicators.calculateIndicator(Instrument,
Period, new OfferSide[]{ OfferSide.BID }, IndicatorName,
new IIndicators.AppliedPrice[]{ IIndicators.AppliedPrice.CLOSE,
IIndicators.AppliedPrice.LOW },new Object[] {},indFilter,
1, bidBar.getTime(), 0);

It compiled fine, but then running the strategy would generate ArrayIndexOutOfBoundsException.

If you want to know the outcome come and check my jforex blog and get the correct code here:

Please login to comment .