Heikin Ashi RSI candlesticks For ThinkOrSwim

SugarTrader

Member
The Heikin Ashi RSI candlestick is a valuable tool for traders, offering a clearer view of trends by smoothing out price noise. It differs from traditional candles by considering the previous period's open, close, high, and low prices.

Integrating Heikin Ashi with RSI:
  1. Identifying Trends: Heikin Ashi helps spot trends more effectively. Paired with RSI, it aids in identifying potential reversals and confirming momentum.
  2. Divergence Analysis: Watch for divergences between Heikin Ashi trends and RSI values, indicating potential reversals.
  3. Confirmation Signals: Use Heikin Ashi patterns to confirm RSI signals, enhancing trading strategy confidence.
QhogDot.png

Hello,
Does anyone know how to code this script in TOS language please?
Thanks ❤️

https://www.tradingview.com/script/ICSNht9h-RSI-CANDLESTICKS/
 
Last edited by a moderator:
Hello,
Does anyone know how to code this script in TOS language please?
Thanks ❤️

https://www.tradingview.com/script/ICSNht9h-RSI-CANDLESTICKS/
check the below

CSS:
#/@version=4
#study("RSI CANDLESTICKS", overlay=false, precision=2)
# converted by Sam4Cok@Samer800    - 03/2024

declare lower;

input chartType = {Default "Candle", "Heikin Ashi"};
input rsiLength = 14;
input overBought = 70;    # "Over Bought Limit"
input overSold   = 30;      # "Over Sold Limit"


def na = Double.NaN;
def last = isNaN(close);

def O = RSI(Price = open , Length = rsiLength);
def H = RSI(Price = high , Length = rsiLength);
def L = RSI(Price = low  , Length = rsiLength);
def C = RSI(Price = close, Length = rsiLength);

def c1 = (o + h + l + c) / 4;
def o1 = CompoundValue(1, (o1[1] + c1[1]) / 2, (o[1] + c[1]) / 2);
def h1 = Max(Max(h, o1), c1);
def l1 = Min(Min(l, o1), c1);

def oo; def hh; def ll; def cc;
Switch (chartType) {
Case "Heikin Ashi":
    oo = o1;
    hh = h1;
    ll = l1;
    cc = c1;
Default:
    oo = o;
    hh = h;
    ll = l;
    cc = c;
}

def up = CC > OO;

def opUp = if up then OO else na;
def hiUp = if up then HH else na;
def loUp = if up then LL else na;
def clUp = if up then CC else na;

def opDn = if up then na else OO;
def hiDn = if up then na else HH;
def loDn = if up then na else LL;
def clDn = if up then na else CC;

# Plot the new Chart

AddChart(open = clUp, high = hiUp , low = loUp , close = opUp,
         type = ChartType.HEIKIN_ASHI, growcolor =  CreateColor(0,206,209));

AddChart(open = OpDn, high = hiDn , low = loDn , close = clDn,
         type = ChartType.HEIKIN_ASHI, growcolor =  CreateColor(220,20,60));


plot midLine = if last then na else 50;
midLine.SetDefaultColor(Color.GRAY);
midLine.SetStyle(Curve.SHORT_DASH);
def obLevel = if last then na else overBought;
def osLevel = if last then na else overSold;

AddCloud(Double.POSITIVE_INFINITY, obLevel, Color.DARK_RED);
AddCloud(osLevel, Double.NEGATIVE_INFINITY, Color.DARK_GREEN);
#-- End of CODE
 
check the below

CSS:
#/@version=4
#study("RSI CANDLESTICKS", overlay=false, precision=2)
# converted by Sam4Cok@Samer800    - 03/2024

declare lower;

input chartType = {Default "Candle", "Heikin Ashi"};
input rsiLength = 14;
input overBought = 70;    # "Over Bought Limit"
input overSold   = 30;      # "Over Sold Limit"


def na = Double.NaN;
def last = isNaN(close);

def O = RSI(Price = open , Length = rsiLength);
def H = RSI(Price = high , Length = rsiLength);
def L = RSI(Price = low  , Length = rsiLength);
def C = RSI(Price = close, Length = rsiLength);

def c1 = (o + h + l + c) / 4;
def o1 = CompoundValue(1, (o1[1] + c1[1]) / 2, (o[1] + c[1]) / 2);
def h1 = Max(Max(h, o1), c1);
def l1 = Min(Min(l, o1), c1);

def oo; def hh; def ll; def cc;
Switch (chartType) {
Case "Heikin Ashi":
    oo = o1;
    hh = h1;
    ll = l1;
    cc = c1;
Default:
    oo = o;
    hh = h;
    ll = l;
    cc = c;
}

def up = CC > OO;

def opUp = if up then OO else na;
def hiUp = if up then HH else na;
def loUp = if up then LL else na;
def clUp = if up then CC else na;

def opDn = if up then na else OO;
def hiDn = if up then na else HH;
def loDn = if up then na else LL;
def clDn = if up then na else CC;

# Plot the new Chart

AddChart(open = clUp, high = hiUp , low = loUp , close = opUp,
         type = ChartType.HEIKIN_ASHI, growcolor =  CreateColor(0,206,209));

AddChart(open = OpDn, high = hiDn , low = loDn , close = clDn,
         type = ChartType.HEIKIN_ASHI, growcolor =  CreateColor(220,20,60));


plot midLine = if last then na else 50;
midLine.SetDefaultColor(Color.GRAY);
midLine.SetStyle(Curve.SHORT_DASH);
def obLevel = if last then na else overBought;
def osLevel = if last then na else overSold;

AddCloud(Double.POSITIVE_INFINITY, obLevel, Color.DARK_RED);
AddCloud(osLevel, Double.NEGATIVE_INFINITY, Color.DARK_GREEN);
#-- End of CODE

Thank you Samer, very helpful.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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