I'd like to use the lower bollinger band (1 standard deviations) as a stop loss for a long position. I tried using the below snippets of code. However, It does not work even though I set bbands to double data type. What am I doing wrong / can I correct to remedy the situation?
lBBand1 = indicators.bbands(instrument, selectedPeriod, OfferSide.BID, AppliedPrice.HIGH, 12, 1,1, MaType.SMA,0)[2];
double LstopLossPrice = lBBand1;
order = engine.submitOrder(getLabel(instrument), instrument, OrderCommand.BUY, 0.01,0,5,LstopLossPrice,SstopLossPrice);
The ERROR I get on the console is
Quote:
05:58:56 Order REJECTED: SELL EUR/USD, REASON: STOP LOSS Invalid price format - please use increments of 0.1 pip.; TAKE PROFIT Invalid price format - please use increments of 0.1 pip.
Cheers,
RG