/*
* Check if the order can be fulfilled immediately
* i.e., if the current price is less than the buy price
* or the current price is more than the sell price.
*/
if (((tradeType == TradeType.eLimitBuy || tradeType == TradeType.eStopLoss) && priceAtPendingTime.lessThanOrEqual(limitPrice)) ||
((tradeType == TradeType.eLimitSell) && limitPrice.lessThanOrEqual(priceAtPendingTime))) {
// Trigger the order immediately.
submissionTimeFromPending = rnd.doubleRange(0.5 * meanInTheMoneySubmissionDelay, 1.5 * meanInTheMoneySubmissionDelay);
}
else {