QQE v2 For ThinkOrSwim

mbarcala

Active member
This is another visual idea of QQE

Upper Indicator: https://usethinkscript.com/threads/break-keltner-bands-bkb-for-thinkorswim.11220/
Photo
14900[/ATTACH]']
HUC64Dl.png


script
Code:
# QQE Indicator v2 by mbarcala at useThinkScript.com

declare lower;

input RSI_Period = 20;
input Slow_Factor = 5;

def RSIndex = 4.236;
def Wilder_Period = RSI_Period * 2 - 1;
def rsi = RSI(price = close, length = RSI_Period).RSI;

plot QQE = ExpAverage(rsi, Slow_Factor) - 50;
QQE.SetDefaultColor(Color.MAGENTA);
QQE.SetLineWeight(2);
QQE.HideBubble();
QQE.HideTitle();

def atr_rsi = AbsValue(QQE[1] - QQE);
def atr_rsi_ma = ExpAverage(atr_rsi, Wilder_Period);
def DeltaFastAtrRsi = ExpAverage(atr_rsi_ma, Wilder_Period) * RSIndex;
def newshortband =  QQE + DeltaFastAtrRsi;
def newlongband = QQE - DeltaFastAtrRsi;

def longband = if QQE[1] > longband[1] and QQE > longband[1] then max(longband[1],newlongband) else newlongband;
def shortband = if QQE[1] < shortband[1] and  QQE < shortband[1] then min(shortband[1], newshortband) else newshortband;
def trend = if Crosses(QQE, shortband[1]) then 1 else if Crosses(longband[1], QQE) then -1 else if !IsNAN(trend[1]) then trend[1] else 1;

plot pFastAtrRsiTL = if trend == 1 then longband else shortband;
pFastAtrRsiTL.SetStyle(Curve.SHORT_DASH);
pFastAtrRsiTL.SetDefaultColor(Color.DARK_GRAY);

plot sdir = if QQE > pFastAtrRsiTL then 0 else if QQE < pFastAtrRsiTL then 0 else Double.NaN;
sdir.AssignValueColor(if QQE > pFastAtrRsiTL then Color.GREEN else if QQE < pFastAtrRsiTL then Color.RED else Color.CURRENT);

plot sdirsq = if QQE crosses above pFastAtrRsiTL then 0 else if QQE crosses below pFastAtrRsiTL then 0 else Double.NaN;
sdirsq.SetPaintingStrategy(PaintingStrategy.SQUARES);
sdirsq.AssignValueColor(if QQE crosses above pFastAtrRsiTL then Color.GREEN else if QQE crosses below pFastAtrRsiTL then Color.RED else Color.CURRENT);
sdirsq.SetLineWeight(3);

plot midline = 0;
midline.SetDefaultColor(Color.DARK_GRAY);
midline.SetLineWeight(1);
midline.HideTitle();

plot upArrow = if QQE crosses above pFAstAtrRsiTL then QQE - 0.5 else Double.NaN;
upArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
upArrow.SetDefaultColor(Color.WHITE);
upArrow.SetLineWeight(1);
upArrow.HideBubble();
upArrow.HideTitle();

plot dnArrow = if QQE crosses below pFastAtrRsiTL then QQE - -0.5 else Double.NaN;
dnArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
dnArrow.SetDefaultColor(Color.WHITE);
dnArrow.SetLineWeight(1);
dnArrow.HideBubble();
dnArrow.HideTitle();

def upZone = midline + 2;
def dnZone = midline - 2;
AddCloud(upZone, dnZone, Color.BLACK);
 

Attachments

  • HUC64Dl.png
    HUC64Dl.png
    411.3 KB · Views: 204
Last edited by a moderator:
This is great too, thanks for sharing this one too....I know I asked this before on a different indicator, but what needs to be added at the bottom to alert when an arrow gets painted on this one?
 
This is great too, thanks for sharing this one too....I know I asked this before on a different indicator, but what needs to be added at the bottom to alert when an arrow gets painted on this one?

Code:
Alert(upArrow, "QQE UP ARROW", Alert.BAR, Sound.Chimes);
Alert(dnArrow, "QQE DOWN ARROW", Alert.BAR, Sound.Ding);

You can also change the sounds to your preference.
  • Bell
  • Ding
  • Ring
  • Chimes

Hope this helps.
 

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
190 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