TSI/RSI Long Signal

TSI_RSI_LongSignal

Function Name: TSI_RSI_LongSignal

Tags: None

Category: Trend

There are two RSI entry values to be identified. The first one is the entry value for trading when the trend condition (Close>MA50 or ROC(150)>0) is met and the second RSI value is the one for trades in case our trend condition isn't met. The idea is to have TSI to help define if the market is in a trending environment. So let's define a TSI>1.65 as trending vs. non-trending. So in total we have a matrix of 4 RSI entry values: Long condition is given (Close > MA(50) or ROC(150)>0):

- RSI1: TSI>1.65

- RSI2: TSI<1.65 Long condition is NOT given:

- RSI3: TSI>1.65

- RSI4: TSI<1.65 If the market is above 1.65 it's in a trending environment and we want to exit the trade later than in a non-trending environment. The best value to exit in a trending environment is above 61 while it's recommended to exit at 39 in a non-trending environment.

 

Parameters:

MAperiod, ROCperiod, RSIperiod: Period values for corresponding functions.

TSIthreshold: Trending vs nontrending value.

RSI1, RSI2, RSI3, RSI4: As defined in description above

RSIexit1, RSIexit2: RSI exit values in trending and nontrending environment, respectively.

ShowConsecutive: Toggles display of multiple consecutive buy/sell markers. If True, will show up to three consecutive buy (sell) markers.

 

Author: Frank Hassler

Source: "Combining TSI and RSI into a winning swing trading system" by Frank Hassler, engineering-returns.com

Link: http://engineering-returns.com/2010/07/13/tsi_rsi_system_parti/

Link: http://engineering-returns.com/2010/07/14/tsi_rsi_system_partii/

 

Parameters

MAperiod

moving average period

 

Default Value: 50  |  Minimum: 1  |  Maximum: 9999

 

Type: Numeric

ROCperiod

rate of change period

 

Default Value: 150  |  Minimum: 1  |  Maximum: 9999

 

Type: Numeric

RSIperiod

used for short-term weakness detection

 

Default Value: 2  |  Minimum: 1  |  Maximum: 9999

 

Type: Numeric

TSIthreshold

trending vs nontrending threshold

 

Default Value: 1.6499999999999999  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

RSI1

RSI threshold 1

 

Default Value: 18  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

RSI2

RSI threshold 2

 

Default Value: 8  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

RSI3

RSI threshold 3

 

Default Value: 13  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

RSI4

RSI threshold 4

 

Default Value: 2  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

RSIexit1

RSI exit threshold in trending

 

Default Value: 61  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

RSIexit2

RSI exit threshold in non-trending

 

Default Value: 39  |  Minimum: 0  |  Maximum: 100

 

Type: Numeric

ShowConsecutive

display multiple buy/sell signals in a row

 

Default Value: 0

 

Type: Boolean