Close all the positions in the sequence
Close all the positions in the sequence
Filter out the sequence of items based on specified criteria
Filter out the sequence of items based on specified criteria
val sequenceOfPositions = this.selectPosition(positionID="2212") // only select positions which are profitable (gainLoss > 0) val profitablePositions = sequenceOfPositions.filter({ curPosition => curPosition.gainLoss > 0 })
Loop through the items in a sequence, and for each item, evaluate the function that was passed in as an argument
Loop through the items in a sequence, and for each item, evaluate the function that was passed in as an argument
val sequenceOfPositions = this.selectPosition(orderID="2212") // for each position, get the profit / loss for that position sequenceOfPositions.foreach ({ curPosition => val profitLoss = curPosition.gainLoss })
Get number of items in sequence
Get number of items in sequence
Transform the sequence of items (Type A) into a sequence of a different type (Type B)
Transform the sequence of items (Type A) into a sequence of a different type (Type B)
var positionSeq = this.selectPosition(orderID="myOrders1") // convert sequence of generic positions into a sequence of vertical spreads var verticalSeq = positionSeq.map({ curPosition => curPosition.asStrategy.vertical })
Convert the sequence into a Scala Seq object
Convert the sequence into a Scala Seq object
A sequence of zero or more positions