Hi
I have spent the better part of last week figuring out the calculateIndicator method with all possible parameters. This is the only method that should return the correct values based on your flat filters and bid/ask settings for ANY indicator.
Object[] com.dukascopy.api.IIndicators.calculateIndicator(Instrument instrument, Period period, OfferSide[] side, String functionName, AppliedPrice[] inputTypes, Object[] optParams,
Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter) throws JFException
Let us start with the ICHIMOKU. I called the calculateIndicator method and extracted the last seven bars and then displayed them in raw format.
[0] 1.307490; [1] 1.307490; [2] 1.307490; [3] 1.307510; [4] 1.307620; [5] 1.307640; [6] 1.307645;
[0] 1.307765; [1] 1.307765; [2] 1.307795; [3] 1.307795; [4] 1.307795; [5] 1.307795; [6] 1.307795;
[0] 1.307560; [1] 1.307600; [2] 1.307610; [3] 1.307620; [4] 1.307580; [5] 1.307760; [6] 1.307770;
[0] 1.307628; [1] 1.307628; [2] 1.307642; [3] 1.307652; [4] 1.307708; [5] 1.307718; [6] 1.307720;
[0] 1.307765; [1] 1.307765; [2] 1.307795; [3] 1.307795; [4] 1.307795; [5] 1.307795; [6] 1.307795;
Here are the things that I learnt:
1) the later down the column is, the more current the value
2) each column holds the t,k,c,sa, sb values
I wrote a little method to extract the data as needed and it looks very scary:
return (((double[]) objectArray[ichiName])[nBar]);
the ichiName is a value from 0 to 4 and the nBar is the offset (actually the index of the array)
The best is to run the strategy once and look at the outputs
I also included the pivot indicator and for some reason it only gives me the last values for the support and resistance areas
[0] 1.316763; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] 1.323327; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] 1.312277; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] 1.327813; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] 1.305713; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] 1.334377; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] 1.301227; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
[0] .000000; [1] ?; [2] ?; [3] ?; [4] ?; [5] ?; [6] ?;
This seems to be an error and should be reported......but as I am not a super coder, I am a bit hesitant to say things are wrong if I am not totally sure.