Analytical

View as Markdown

NinjaScript provides a number of methods and properties useful for analyzing and identifying specific conditions within Series\<t\> collections. Some of these methods test a condition and return true or false, while others return an int-based bar index or other numerical value. A list of analytical methods can be found below:

Methods and PropertiesDescription
CountIf()Counts the number of occurrences of the test condition
CrossAbove()Evaluates a cross above condition
CrossBelow()Evaluates a cross below condition
GetCurrentAsk()Returns the current Ask price
GetCurrentAskVolume()Returns the current Ask volume
GetCurrentBid()Returns the current Bid price
GetCurrentBidVolume()Returns the current Bid volume
GetMedian()Returns the median value of the specified series
HighestBar()Returns the number of bars ago the highest price value occurred
IsFalling()Evaluates a falling condition
IsRising()Evaluates a rising condition
Least Recent Occurrence (LRO)Returns the number of bars ago that the least recent occurrence of a test condition evaluated to true
LowestBar()Returns the number of bars ago the lowest price value occurred
Most Recent Occurrence (MRO)Returns the number of bars ago that the most recent occurrence of a test condition evaluated to true
Slope()Returns a measurement of the steepness of a price series measured by the change over time
TickSizeThe value of 1 tick for the corresponding instrument
ToDay()Calculates an integer value representing a date
ToTime()Calculates an integer value representing a time