Overbought Oversold Indicator For ThinkOrSwim

joefresh

New member
Hello,

There is a pine script by Ceyhun "Overbought Oversold Indicator on TradingView" I have searched this forum and many others for a compatible working version
for ThinkorSwim. To no avail, I was not able to find anything similar to this script from TradingView.
Any help in converting this pine script code to Thinkscript is greatly appreciated. In advance...Thank you !!!
Here is the link to his script: https://www.tradingview.com/script/RLoA9E77/
and the link to the image : https://www.tradingview.com/i/RLoA9E77/

================
 

Attachments

  • 2023-08-19 14_28_26-Trader ceyhun — Trading Ideas & Charts — TradingView.jpg
    2023-08-19 14_28_26-Trader ceyhun — Trading Ideas & Charts — TradingView.jpg
    327.7 KB · Views: 383
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Hello,

There is a pine script by Ceyhun "Overbought Oversold Indicator on TradingView" I have searched this forum and many others for a compatible working version
for ThinkorSwim. To no avail, I was not able to find anything similar to this script from TradingView.
Any help in converting this pine script code to Thinkscript is greatly appreciated. In advance...Thank you !!!
Here is the link to his script: https://www.tradingview.com/script/RLoA9E77/
and the link to the image : https://www.tradingview.com/i/RLoA9E77/

================

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ceyhun
//@version=4
study("Overbought Oversold Indicator")
n = input(5, title="Length")
Barcolor=input(true,title="Barcolor")
ys1 = (high + low + close * 2) / 4
rk3 = ema(ys1, n)
rk4 = stdev(ys1, n)
rk5 = (ys1 - rk3) * 100 / rk4
rk6 = ema(rk5, n)
up = ema(rk6, n)
down = ema(up, n)
Oo = iff(up < down, up, down)
Hh = Oo
Ll = iff(up < down, down, up)
Cc = Ll
b_color = iff(Oo[1] < Oo and Cc < Cc[1], #FFFF00, iff(up > down, #008000, #FF0000))
barcolor(Barcolor ? b_color : na)
hline(0)
plot(Oo, style=plot.style_histogram, color=b_color)
plot(Ll, style=plot.style_histogram, color=b_color)
plot(up, color=b_color,title="Up")
plot(down, color=b_color,title="Down")
Buy = crossover(up, down)
Sell = crossunder(up, down)
plotshape(Buy, title="Buy", color=#008000, style=shape.triangleup, location=location.bottom, text="Buy",size=size.tiny)
plotshape(Sell, title="Sell", color=#FF0000, style=shape.triangledown, location=location.top, text="Sell",size=size.tiny)
alertcondition(Buy, title="Buy Signal", message="Buy")
alertcondition(Sell, title="Sell Signal", message="Sell")
find below

CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at
#// © ceyhun
#study("Overbought Oversold Indicator")
# Converted by Sam4Cok@Samer800    - 09/2023
Declare lower;

input BarColor = yes;
input showSignals = yes;
input MovAvgType = AverageType.EXPONENTIAL;
input length = 5;


def na = Double.NaN;
def ys1 = (high + low + close * 2) / 4;
def rk3 = MovingAverage(MovAvgType, ys1, length);
def rk4 = stdev(ys1, length);
def rk5 = (ys1 - rk3) * 100 / rk4;
def rk6 = MovingAverage(MovAvgType, rk5, length);
def up = MovingAverage(MovAvgType, rk6, length);
def down = MovingAverage(MovAvgType, up, length);
def Oo = if(up < down, up, down);
def Hh = Oo;
def Ll = if(up < down, down, up);
def Cc = Ll;

def b_color = if(Oo[1] < Oo and Cc < Cc[1], 0, if(up > down, 1, -1));

AssignPriceColor(if !Barcolor then Color.CURRENT else
                 if b_color > 0 then Color.GREEN else
                 if b_color < 0 then Color.RED else Color.GRAY);

plot UpMov = up;
plot DnMov = down;
UpMov.SetLineWeight(2);
DnMov.SetLineWeight(2);
UpMov.AssignValueColor(if b_color > 0 then Color.GREEN else
                       if b_color < 0 then Color.RED else Color.WHITE);
DnMov.AssignValueColor(if b_color > 0 then Color.GREEN else
                       if b_color < 0 then Color.RED else Color.WHITE);

plot HiHi = Oo;
plot LoLo = Ll;
HiHi.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
LoLo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
HiHi.AssignValueColor(if b_color > 0 then Color.DARK_GREEN else
                      if b_color < 0 then Color.DARK_RED else Color.WHITE);
LoLo.AssignValueColor(if b_color > 0 then Color.DARK_GREEN else
                      if b_color < 0 then Color.DARK_RED else Color.WHITE);

def Buy = Crosses(up, down, CrossingDirection.ABOVE);
def Sell = Crosses(up, down, CrossingDirection.BELOW);

AddVerticalLine(showSignals and Buy, "Buy", Color.CYAN, Curve.POINTS);
AddVerticalLine(showSignals and Sell, "Sell", Color.MAGENTA, Curve.POINTS);


#-- END of CODE
 
Pls add Multi-Time to this code
#// This source code is subject to the terms of the Mozilla Public License 2.0 at
#// © ceyhun
#study("Overbought Oversold Indicator")
# Converted by Sam4Cok@Samer800 - 09/2023
Declare lower;

input BarColor = yes;
input showSignals = yes;
input MovAvgType = AverageType.EXPONENTIAL;
input length = 5;


def na = Double.NaN;
def ys1 = (high + low + close * 2) / 4;
def rk3 = MovingAverage(MovAvgType, ys1, length);
def rk4 = stdev(ys1, length);
def rk5 = (ys1 - rk3) * 100 / rk4;
def rk6 = MovingAverage(MovAvgType, rk5, length);
def up = MovingAverage(MovAvgType, rk6, length);
def down = MovingAverage(MovAvgType, up, length);
def Oo = if(up < down, up, down);
def Hh = Oo;
def Ll = if(up < down, down, up);
def Cc = Ll;

def b_color = if(Oo[1] < Oo and Cc < Cc[1], 0, if(up > down, 1, -1));

AssignPriceColor(if !Barcolor then Color.CURRENT else
if b_color > 0 then Color.GREEN else
if b_color < 0 then Color.RED else Color.GRAY);

plot UpMov = up;
plot DnMov = down;
UpMov.SetLineWeight(2);
DnMov.SetLineWeight(2);
UpMov.AssignValueColor(if b_color > 0 then Color.GREEN else
if b_color < 0 then Color.RED else Color.WHITE);
DnMov.AssignValueColor(if b_color > 0 then Color.GREEN else
if b_color < 0 then Color.RED else Color.WHITE);

plot HiHi = Oo;
plot LoLo = Ll;
HiHi.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
LoLo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
HiHi.AssignValueColor(if b_color > 0 then Color.DARK_GREEN else
if b_color < 0 then Color.DARK_RED else Color.WHITE);
LoLo.AssignValueColor(if b_color > 0 then Color.DARK_GREEN else
if b_color < 0 then Color.DARK_RED else Color.WHITE);

def Buy = Crosses(up, down, CrossingDirection.ABOVE);
def Sell = Crosses(up, down, CrossingDirection.BELOW);

AddVerticalLine(showSignals and Buy, "", Color.CYAN, Curve.FIRM);
AddVerticalLine(showSignals and Sell, "", Color.MAGENTA, Curve.FIRM);

# Alerts
Alert(Buy, " ", Alert.Bar, Sound.Chimes);
Alert(Sell, " ", Alert.Bar, Sound.Bell);

#-- END of CODE
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
436 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