NinjaScript > Language Reference > Data >

Slope()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
The slope is a measure of the steepness of a line.
 

Method Return Value

This method returns a double value indicating the slope of a line

 

Syntax
Slope(IDataSeries series, int startBarsAgo, int endBarsAgo)

 

Parameters

series

Any DataSeries type object such as an indicator, Close, High, Low, etc...

startBarsAgo

Specifies the starting point of a line

endBarsAgo

Specifies the ending point of a line

 

 
Examples

// Prints the slope of the 20 period simple moving average of the last 10 bars
Print(Slope(SMA(20), 10, 0));