#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;}

## Slope of Support and Resistance Lines

by QuantShare, 4137 days ago

The "AutoSR" function is a very useful trading indicator that automatically calculates support and resistance lines for any security. It can be used to calculate the last support or resistance lines (Detect chart patterns using the auto support/resistance indicator) or it can be used to calculate the support and resistance lines of each trading bar (Backtesting chart patterns using the auto support and resistance indicator) and thus make it very powerful when it comes to backtesting trading systems.

The "SlopeAutoSR" function is used in the following article (Backtesting chart patterns using the auto support and resistance indicator). See the "Backtesting the Falling Wedge Chart Pattern" paragraph.

It calculates the slope of the resistance or support line. The slope is important when it comes to detecting and backtesting chart patterns such as the Falling or rising wedge patterns.

This indicator uses the built in "TA.AutoSR" function, which returns for each trading bar an array containing three values: The support or resistance level, the line slope and the intercept.

"SlopeAutoSR" function parameters:
Param 1: Set 0 to calculate the last support line, 1 for the last resistance line, 2 for the support line of each trading bar and 3 for the resistance line of each trading bar.
Param 2: Lag Period. It instructs QuantShare to end the calculation of the lines at current bar minus lag
Param 3: Lookback Period. It instructs QuantShare to start calculating the lines at current bar minus lookback period minus lag.

Example of usage:
degree = SlopeAutoSR(3, 1, 50) * (180/3.14);

When used in a trading system, the above formula enters long when the angle of the 50-bar resistance line becomes higher than 30 degrees.

Note that slope is measured in radians. We can convert it to degrees by multiplying it with (180 / 3.14).

What is this?

 Type: Trading Indicator Object ID: 1275 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 Using Average True Range to Measure Intraday Volatility How to Backtest Your Trading System for Each Industry Create Profitable Trading Strategies with Exchange Traded Funds (ETFs) 3 Market Indicators based on Fundamental Data How to Send Commands to QuantShare from Excel or Other Applications How to make sure your Historical Price Data is Split Adjusted How to Select the Best Market Indicator for your Trading System 4 Market Composite Indicators Based on Industry Data 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