Hello,
I'm working on my own strategy and I've found out that indicators showed on graphs and indicators from strategy code have different values. Lets take MACD as example. I'm running my strategy that does nothing except printing MACD values (EUR/USD chart. "Last month" is a good sample time frame on Historical Tester):
void printMsg(String text)
{
console.getOut().println(text);
}
int getMacdDir(Instrument instrument, Period period) throws JFException
{
double macdCur[] = indicators.macd(instrument, period, OfferSide.BID,AppliedPrice.CLOSE,12,26,9,0);
printMsg(String.format("%.6g", macdCur[0])+" "+String.format("%.6g",macdCur[1]));
return 0;
}
public void onBar(Instrument instrument, Period period, IBar askbar,
IBar bidbar) throws JFException {
if (period != Period.ONE_HOUR) return;
getMacdDir(instrument,period);
}
I see different MACD values in log and on chart. I have the same problem with Ichimoku.
I have feeling that maybe MACD parameters are incorrect. Can you help me with it please?