Karobein Oscillator For ThinkOrSwim

eagle_ai

Member
The author states: The Karobein oscillator is an oscillator that aim to rescale smoothed values with more reactivity in a range of (0,1).

How To Use
It is better to use centerline-cross/breakouts/signal line.

In general when we use something smooth as input in oscillators, breakouts are better than reversals, you can see this with the stochastic and rsi.

So a simple approach could be buying when crossing over 0.8 and selling when crossing under 0.2.


RFRBKkw.png


Original Tradingview code
https://www.tradingview.com/script/JiNi0f62-Karobein-Oscillator/

For the new ThinkOrSwim code, you must scroll down to the next post
 
Last edited by a moderator:

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

check the below

CSS:
# Indicator for TOS
#//@alexgrover
#study("Karobein Oscillator")
# Converted by Sam4Cok@Samer800    - 11/2024

declare lower;

input timeframe  = AggregationPeriod.MIN;
input movAvgType = AverageType.EXPONENTIAL;
input source = FundamentalType.CLOSE;
input length = 50;
input showSignalLines = yes;
input thresholdBull = 80;
input thresholdBear = 20;
input useSmoothing = no;
input smoothingLength = 9;
input colorBars = yes;

def na = Double.NaN;
def last = IsNaN(close);
def cap = GetAggregationPeriod();
def tf = Max(cap, timeframe);

def ema = MovingAverage(movAvgType, Fundamental(source, Period = tf), length);
def a   = MovingAverage(movAvgType, if ema < ema[1] then ema / ema[1] else 0, length);
def b   = MovingAverage(movAvgType, if ema > ema[1] then ema / ema[1] else 0, length);
def c = (ema / ema[1]) / (ema / ema[1] + b);
def d = 2 * ((ema / ema[1]) / (ema / ema[1] + c * a)) - 1;
def Karobein = d * 100;
def smD = MovingAverage(movAvgType, Karobein, smoothingLength);
#-- Plot
def mid = (thresholdBull + thresholdBear) / 2;
plot KarobeinOsc = if last then na else if useSmoothing then smD else Karobein;
plot zr = if last then na else mid;
plot ob = if last then na else thresholdBull;
plot os = if last then na else thresholdBear;

zr.SetStyle(Curve.SHORT_DASH);
KarobeinOsc.SetLineWeight(2);
KarobeinOsc.SetDefaultColor(Color.GRAY);
zr.SetDefaultColor(Color.DARK_GRAY);
ob.SetDefaultColor(Color.DARK_GREEN);
os.SetDefaultColor(Color.DARK_RED);

AddCloud(KarobeinOsc,  ob,  Color.DARK_GREEN,  Color.CURRENT);
AddCloud(os, KarobeinOsc, Color.DARK_RED, Color.CURRENT);

#-- Bar Color

AssignPriceColor(if !colorBars then Color.CURRENT else
                 if KarobeinOsc > thresholdBull then Color.GREEN else
                 if KarobeinOsc < thresholdBear then Color.RED else
                 if KarobeinOsc > mid then Color.DARK_GREEN else
                 if KarobeinOsc > thresholdBear then Color.DARK_RED else Color.GRAY);
#-- Signals

AddVerticalLine(showSignalLines and (KarobeinOsc Crosses Above thresholdBull), "B", Color.GREEN);
AddVerticalLine(showSignalLines and (KarobeinOsc Crosses Below thresholdBear), "S", Color.RED);

#-- END of CODE
 
  • Love
Reactions: IPA

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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