#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

 by QuantShare, 5011 days ago

A trading rule has only two states, black or while, true or false. In a given period, the state of a trading rule could remain constant (true or false) or it could change one or several times from one state to another. During this period, it could be interesting to calculate the percentage of time (bars) where the trading rule was true; consequently we will also discover the percentage of trading bars where the trading rule was false.

This trading indicator allows you to perform such calculation for a given number of bars. The indicator function has two parameters. The first one takes the time series or trading rule that you want to analyze and the second parameter takes the number of trading bars that the indicator should analyze to compute the percentage of bars the trading rule was true or higher than zero.

For example, the following formula: PerValue(rsi(14) > 70, 30) calculates for each trading bar, the percentage of times the Relative Strength Index was higher than 70 during the last 30 bars. A value of 100 indicates that the RSI was always higher than 70 during the last 30 bars.

Here is another example:
PerValue(close > sma(10), 20)

This trading indicator returns the percentage of bars, during the previous 20 bars, where the provided trading rule returns a buy signal (may also be interpreted as a sell signal); that is the close price of an asset is higher than its 10-Bar simple moving average.

This PerValue indicator is similar to another one - % bars in last N trading days where stock close price increased. The latter calculates the percentage of bars where the provided time series increased compared to its previous bar value.

What is this?

 Type: Trading Indicator Object ID: 694 Country: All Market: All Style: Technical Analysis

 Related objects Empty
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

 Random Blog Posts Trading Indicators using the Rank and Percentile functions How to Create Custom Metrics for Your Trading Positions How to search for a trading item How to create market indicators using the composite function - Part 3 How to create market indicators using the composite function - Part 2 Create a Pivot Table that displays the Relative Strength Index - RSI 6 Stock Trading Items Related to the New York Stock Exchange - NYSE Pivot Tables in QuantShare Trading Software Show All

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object