com.optstack.api

SequenceT

class SequenceT[T] extends AnyRef

A sequence of zero or more objects.

To reference an index of the sequence, use parenthesis as follows:

val sequenceOfPositions = this.selectPosition(orderID="2212")

sequenceOfPositions(0)		// first position
sequenceOfPositions(1)		// second position

To loop through a sequence of elements, use the foreach function:

val sequenceOfPositions = this.selectPosition(orderID="2212")

// for each position, get the profit / loss for that position
sequenceOfPositions.foreach ({ curPosition =>
	val profitLoss =  curPosition.gainLoss
})

To filter out the sequence of elements, use the filter function:

val sequenceOfPositions = this.selectPosition(positionID="2212")

// only select positions which are profitable (gainLoss > 0)
val profitablePositions = sequenceOfPositions.filter({ curPosition =>
  	curPosition.gainLoss > 0
})
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SequenceT
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SequenceT(list: Seq[T])

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def apply(index: Int): T

    Annotations
    @FunctionInfo()
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. final def filter(func: (T) ⇒ Boolean): SequenceT[T]

    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
    })
    Annotations
    @FunctionInfo()
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def foreach[U](func: (T) ⇒ U): Unit

    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
    })
    Annotations
    @FunctionInfo()
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def length: Int

    Get number of items in sequence

    Get number of items in sequence

    Annotations
    @FunctionInfo()
  18. final def map[B](func: (T) ⇒ B): SequenceT[B]

    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
      })
    Annotations
    @FunctionInfo()
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. final def toSeq: Seq[T]

    Convert the sequence into a Scala Seq object

    Convert the sequence into a Scala Seq object

    Annotations
    @FunctionInfo()
  24. def toString(): String

    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped