Trend Reversal Indicator


Category:
0
0

Hi Pete, I’m working on creating a Trend Reversal Indicator in Thinkorswim. The parameters are as follows. Would you be able to provide any help? Thanks in advance!

 

BUY Criteria:
1. Stock is down for multiple days
2. Stock goes below prior day’s low
3. Stock trades back up through prior day’s low, which triggers the buy and adds an Up arrow to the chart.

SELL Criteria:
1. Stock is up for multiple days
2. Stock goes above the prior day’s high
3. Stock trades back down through prior day’s high, which triggers the sell and adds a Down arrow to the chart.

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on April 5, 2020 7:15 am
2255 views
0
Private answer

There have been multiple requests for this exact thing in the forum. However you are the very first of those posts to provide the actual specifications. Thank you!

Here is the code to translates your specifications directly into a chart study script:

input numberOfDays = 6;
def downTrend = close < close[numberOfDays]; def upTrend = close > close[numberOfDays];
plot buySignal = downTrend[1] and low < low[1] and close > low[1];
buySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buySignal.SetDefaultColor(Color.WHITE);
buySignal.SetLineWeight(3);
plot sellSignal = upTrend[1] and high > high[1] and close < high[1];
sellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sellSignal.SetDefaultColor(Color.WHITE);
sellSignal.SetLineWeight(3);

There is a user adjustable input "number of days", which you can use to adjust for the "multiple days" element of your specification.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 5, 2020 8:34 am
0
Thank you for the quick response and the solution!
( at April 5, 2020 8:48 am)