Repaints Trend Reversal for ThinkorSwim

Repaints
Status
Not open for further replies.
@dougn This was requested multiple times. At the moment, I don't think it's possible.
...

Josiah (easycators.com) created this custom watchlist column and it's offered here in the spirit of sharing back with this great community.

Based on his description of what he had to do to get it to work, some compromises had to be made. On initial basic testing I can confirm that the signals identified by the column (bearish and bullish in one) match those signaled by the study.
Code:
####################################### COLUMN
# Trend Reversal
# Dixon72 with modifications by tomsk
# Scanner by https://usethinkscript.com/u/theelderwand
# Column modification by Josiah at https://Easycators.com
# 1.20.2020
input offset = 1;
input withinBars = 1;
def price = close;
def superfast_length = 9;
def fast_length = 14;
def slow_length = 21;
def displace = 0;

def mov_avg9 = ExpAverage(price[-displace], superfast_length);
def mov_avg14 = ExpAverage(price[-displace], fast_length);
def mov_avg21 = ExpAverage(price[-displace], slow_length);

#moving averages
def Superfast = mov_avg9;
def Fast = mov_avg14;
def Slow = mov_avg21;

def buy = mov_avg9 > mov_avg14 and mov_avg14 > mov_avg21 and low > mov_avg9;
def stopbuy = mov_avg9 <= mov_avg14;
def buynow = !buy[1] and buy;
def buysignal = CompoundValue(1, if buynow and !stopbuy then 1 else if buysignal[1] == 1 and stopbuy then 0 else buysignal[1], 0);

def Buy_Signal = buysignal[1] == 0 and buysignal == 1;
def Momentum_Down = buysignal[1] == 1 and buysignal == 0;

def sell = mov_avg9 < mov_avg14 and mov_avg14 < mov_avg21 and high < mov_avg9;
def stopsell = mov_avg9 >= mov_avg14;
def sellnow = !sell[1] and sell;
def sellsignal = CompoundValue(1, if sellnow and !stopsell then 1 else if sellsignal[1] == 1 and stopsell then 0 else sellsignal[1], 0);
def Sell_Signal = sellsignal[1] == 0 and sellsignal;


input method = {default average, high_low};
def bubbleoffset = .0005;
def percentamount = .01;
def revAmount = .05;
def atrreversal = 2.0;
def atrlength = 5;
def pricehigh = high;
def pricelow = low;
def averagelength = 5;
def averagetype = AverageType.EXPONENTIAL;
def mah = MovingAverage(averagetype, pricehigh, averagelength);
def mal = MovingAverage(averagetype, pricelow, averagelength);
def priceh = if method == method.high_low then pricehigh else mah;
def pricel = if method == method.high_low then pricelow else mal;
def EI = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = percentamount, "absolute reversal" = revAmount, "atr length" = atrlength, "atr reversal" = atrreversal);
rec EISave = if !IsNaN(EI) then EI else GetValue(EISave, 1);
def chg = (if EISave == priceh then priceh else pricel) - GetValue(EISave, 1);
def isUp = chg >= 0;
def EIL = if !IsNaN(EI) and !isUp then pricel else GetValue(EIL, 1);
def EIH = if !IsNaN(EI) and isUp then priceh else GetValue(EIH, 1);
def dir = CompoundValue(1, if EIL != EIL[1] or pricel == EIL[1] and pricel == EISave then 1 else if EIH != EIH[1] or priceh == EIH[1] and priceh == EISave then -1 else dir[1], 0);
def signal = CompoundValue(1, if dir > 0 and pricel > EIL then if signal[1] <= 0 then 1 else signal[1] else if dir < 0 and priceh < EIH then if signal[1] >= 0 then -1 else signal[1] else signal[1], 0);

def up = within(signal > 0 and signal[1] <= 0, withinBars);
def down = within(signal < 0 and signal[1] >= 0, withinBars);

plot scan = if up[offset] then 2 else if down[offset] then 1 else 0;
scan.assignValueColor(
         if up[offset] then color.dark_green
    else if down[offset] then color.red
    else color.black);
assignBackgroundColor(
         if up[offset] then color.dark_green
    else if down[offset] then color.red
    else color.black);
####################################### END COLUMN
 

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

I had a repainting issue today 22/01/20 with $FCEL. Sell signal @$2.9 around 12.30pm . It pushed higher and signal vanished on 5min chart.
 
Hello... I have been using the Trend Reversal Indicator for awhile now, I really enjoy looking at charts and understanding the direction the market is moving. I also have the scanner installed and I was wondering if there is an updated version on the scanner posted on the original post #1. I looks like the scanner and the indicator aren't in sync. I am also using the original (post #1) version of the Trend Reversal indicator. Any help would be greatly appreciated. Thank you.
 
There certainly has been quite a few versions of the study that was posted. Because of the repainting feature, don't think you can use this to do live trades though as pointed out by several readers. But the study sure looks so good, that's because it uses future bars to confirm signals - that is the repainting at work!
 
Hey guys I love this indicator so far. I feel pretty stupid I have read all throughout this forum. When I am setting up the scanner it says it is too enhanced to use as a scan? I have set it up for the up or down arrow on the daily chart without 3 bars. and I just cant get it to work correctly for me. What am I doing wrong here?

gYoQ87i.png
 
@ianfaler If this is from the scanner link that we posted in the original thread, it shouldn't give you that error. Have you tried adjusting the watchlist that you'll be using? Sometimes if the watchlist is too big it could become an issue as well.
 
@ianfaler If this is from the scanner link that we posted in the original thread, it shouldn't give you that error. Have you tried adjusting the watchlist that you'll be using? Sometimes if the watchlist is too big it could become an issue as well.
Jeez was picking the actual chart indicator not the scanner. Sorry about that! Thanks for your help
 
Hi I love the trend reversal indicator, I tried to set up the scanner but it gave me alot of stocks. Is there a way to scan for the reversal bubbles that pop up? Im looking to scan my watchlist at night for reversals. Thanks
 
@Sohelator So the scanner is working? If so, you may want to select your own watchlist instead of the one ThinkorSwim gives you. That way you can be selective about the result.
 
@Sohelator So the scanner is working? If so, you may want to select your own watchlist instead of the one ThinkorSwim gives you. That way you can be selective about the result.
It scans but only if i put only up arrow or down arrow but it wont do both, also when i checked the chart on the scan results, i dont see a reversal bubble. Thanks for trying to help, I love this site
 
Ok i changed it to 1 bar, daily and scanned the snp 100. It gave me results but when i check the daily chart, i dont see any reversal signals 1 bar back.
 
@Sohelator Since this indicator repaint, there is a delay in signal, especially the daily chart. So you would need to change from 1 bar to 2 bars.
 
Status
Not open for further replies.

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
290 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top