i have read wiki for quite a while but still not clear about that and this is my code,can someone please tell me where is bug
================================
private IOrder submitOrder(OrderCommand orderCmd) throws JFException {
long goodTillTime = System.currentTimeMillis() + 60*1000*15*30;
double stopLossPrice, takeProfitPrice;
double k=0;
for (int i=1;i<=55;i++)
{
double Bar_length=history.getBar(instrument, selectedPeriod, OfferSide.BID, i).getHigh()-history.getBar(instrument, selectedPeriod, OfferSide.BID, i).getLow();
k=k+Bar_length;
}
k=k/27;
// Calculating stop loss and take profit prices
if (orderCmd == OrderCommand.PLACE_BID) {
stopLossPrice = history.getLastTick(this.instrument).getBid() - getPipPrice(this.stopLossPips)-k;
takeProfitPrice = history.getLastTick(this.instrument).getBid() + getPipPrice(this.takeProfitPips);
console.getOut().println(k);
return engine.submitOrder(getLabel(instrument), this.instrument, orderCmd, this.amount, history.getLastTick(this.instrument).getBid()-k, 2, stopLossPrice, takeProfitPrice,goodTillTime); //this one really submit orders!!!
}
if (orderCmd == OrderCommand.PLACE_OFFER){
stopLossPrice = history.getLastTick(this.instrument).getAsk() + getPipPrice(this.stopLossPips)+k;
takeProfitPrice = history.getLastTick(this.instrument).getAsk() - getPipPrice(this.takeProfitPips);
console.getOut().println(k);
return engine.submitOrder(getLabel(instrument), this.instrument, orderCmd, this.amount, history.getLastTick(this.instrument).getBid()+k, 2, stopLossPrice, takeProfitPrice,goodTillTime); //this one really submit orders!!!
}
===========================
after compiled ,error message is : This method must return a result of type IOrder