IsAscending

IsAscending ( IDataHolder value , int length );

Default values:

length: 3

Description

Tests if the trend is ascending by calculating the average slope coefficient of trendlines whose start points are MidBodyVal for a specified number of bars and end points are value for current bar. If the slope is positive then the trend is considered ascending.

Input parameters

Parameter Default value Description
value - Defines data to test for uptrend conditions.
length 3 Defines period to test for uptrend conditions.

Example

AssignPriceColor(if IsAscending(close, 10) then Color.GREEN else Color.RED);

This example paints price bars in green color if the closing price in comparison to the MidBodyVal for the last 10 bars is considered ascending and in red color otherwise.