Short-Term Continuation And Reversal Signals For ThinkOrSwim

xoxoJNN

New member
VIP
Author's Notes:
This study offers the following signals based on the readings of the DMI and CCI pair, suitable for several types of trades:
  • Short-term Trend Change Signals:
    • A DMI oscillator above zero indicates that prices are in an uptrend.
    • A DMI oscillator below the zero line and falling means that selling pressure is dominating and price is trending down.
    • The sign of the DMI oscillator is indicated by the color of the price bars (which correlates with the color of the DMI histogram).
    • Namely, green, red & grey price bars correspond to the DMI oscillator above, below and equal to zero.
    • Colored price bars and the DMI oscillator make it easy for trend traders to recognize changes in short-term trends.
  • Trend Continuation Signals:
    • Blue circles appear near the bottom of the oscillator chart border when the DMI is above the zero line and the price is above its simple moving average in an uptrend.
    • Dark red circles appear near the top of the chart in a downtrend when the DMI oscillator is below its zero line and below the 18-period moving average.
    • Trend continuation signals are useful for those looking to add to existing positions, as well as for traders waiting for a pullback after a trend has started.
  • Reversal Signals:
    • The CCI signals a reversal to the downside when it breaks out of its +100 and then returns at some point, crossing below the +100 level.
    • This is indicated by a magenta-colored diamond shape near the top the chart.
    • The CCI signals a reversal to the upside when it moves below its −100 level and then at some point comes back to cross above the −100 level.
    • This is indicated by a yellow diamond near the bottom of the chart.
    • Reversal signals offer short-term rallies for countertrend traders as well as for swing traders looking for longer-term moves using the interplay between continuation and reversal signals.
uYjsPJa.png


Original Tradingview code
https://www.tradingview.com/script/...Short-Term-Continuation-And-Reversal-Signals/

Must scroll down to the next post for the new ThinkOrSwim code
 
Last edited by a moderator:
Another one from “Technical Analysis of Stocks & Commodities (TASC)” featuring an article by Barbara Star, PhD titled “Short-Term Continuation And Reversal Signals”. Please help convert this one as well if it's not too much trouble. Thank you in advance for your time. 🙏😄


AUTHOR'S NOTES:

The article offers the following signals based on the readings of the DMI and CCI pair, suitable for several types of trades:
  • Short-term Trend Change Signals:
    • A DMI oscillator above zero indicates that prices are in an uptrend.
    • A DMI oscillator below the zero line and falling means that selling pressure is dominating and price is trending down.
    • The sign of the DMI oscillator is indicated by the color of the price bars (which correlates with the color of the DMI histogram).
    • Namely, green, red & grey price bars correspond to the DMI oscillator above, below and equal to zero.
    • Colored price bars and the DMI oscillator make it easy for trend traders to recognize changes in short-term trends.
  • Trend Continuation Signals:
    • Blue circles appear near the bottom of the oscillator chart border when the DMI is above the zero line and the price is above its simple moving average in an uptrend.
    • Dark red circles appear near the top of the chart in a downtrend when the DMI oscillator is below its zero line and below the 18-period moving average.
    • Trend continuation signals are useful for those looking to add to existing positions, as well as for traders waiting for a pullback after a trend has started.
  • Reversal Signals:
    • The CCI signals a reversal to the downside when it breaks out of its +100 and then returns at some point, crossing below the +100 level.
    • This is indicated by a magenta-colored diamond shape near the top the chart.
    • The CCI signals a reversal to the upside when it moves below its −100 level and then at some point comes back to cross above the −100 level.
    • This is indicated by a yellow diamond near the bottom of the chart.
    • Reversal signals offer short-term rallies for countertrend traders as well as for swing traders looking for longer-term moves using the interplay between continuation and reversal signals.

TRADINGVIEW:

https://www.tradingview.com/script/...Short-Term-Continuation-And-Reversal-Signals/


TT-Tradingview.gif
check the below:

CSS:
#// Indicator for TOS
#//  TASC Issue: December 2022 - Vol. 40, Issue 13
#//     Article: Short-Term Continuation And Reversal Signals
#//  Article By: Barbara Star
#//    Language: TradingView's Pine Script™ v5
#// Provided By: PineCoders, for tradingview.com
#string title = 'TASC 2022.12 ' + 'Short-Term Continuation And Reversal Signals'
# Converted by Sam4Cok@Samer800    - 11/2024
declare lower;

#// Input options:
input colorBars = yes;
input OscillatorMode = {"DMI", "CCI", default "Dual", "Overlay"};
input DMIMult   = 1.0; # it4
input diLength  = 10;  # DMI Length:'
input maLength  = 18;  # 'MA Length:'
input cciLength = 13;  # 'CCI Length:'

def na = Double.NaN;
def last = IsNaN(close);
def MD0 = OscillatorMode == OscillatorMode."DMI";
def MD1 = OscillatorMode == OscillatorMode."CCI";
def MD2 = OscillatorMode == OscillatorMode."Dual";
def MD3 = OscillatorMode == OscillatorMode."Overlay";
#// Indicators:
def ma = Average(close, maLength);
def dp = DMI(Length = diLength)."DI+";
def dm = DMI(Length = diLength)."DI-";
def DMI = dp - dm;
def mDMI = DMIMult * DMI;
def linDev = LinDev(close, cciLength);
def CCI = if linDev == 0 then 0 else (close - Average(close, cciLength)) / linDev / 0.015;
def uCCI = if CCI > +100.0 then CCI else na;
def lCCI = if CCI < -100.0 then CCI else na;
#// Boolean Signals:
def      pGTma = close > ma;
def      pLTma = close < ma;
def  cciGTp100 = CCI > 100;
def  cciLTm100 = CCI < -100;
def     dmiGT0 = DMI > 0;
def     dmiLT0 = DMI < 0;
def    risingL = low > low[1]   and low[1] > low[2];
def    falingH = high < high[1] and high[1] < high[2];
def conUpTrend = pGTma and dmiGT0 and risingL;
def conDoTrend = pLTma and dmiLT0 and falingH;
def cciTop = (!cciGTp100) and cciGTp100[1] and cciGTp100[2];
def cciBot = (!cciLTm100) and cciLTm100[1] and cciLTm100[2];
def useDMI = MD0 or MD2;
def useCCI = MD1 or MD2;
def isOverlay = MD3;
#// Color variation:
def colDMI = if dmiGT0 then 1 else if dmiLT0 then -1 else 0;
def colCCI = if cciGTp100 then 1 else if cciLTm100 then -1 else 0;

#// Output:
def showDMI     = if useDMI    then yes else no; #? display.all  : display.none
def showCCI     = if useCCI    then yes else no; #? display.all  : display.none
def showLVL     = if isOverlay then no else yes; #? display.none : display.all
def showOverlay = if isOverlay then yes else no; #? display.all  : display.none

#// Oscillator signals:
plot ConSigUp = if showLVL and conUpTrend then if MD0 then -30 else -250 else na;
plot ConSigDn = if showLVL and conDoTrend then if MD0 then 30 else 250 else na;
plot cciSigTop = if showLVL and cciTop then if MD0 then 30 else 250 else na;
plot cciSigBot = if showLVL and cciBot then if MD0 then -30 else -250 else na;
#// Overlaid signals:
plot conTrdUp = if showOverlay and conUpTrend then low else na;
plot conTrdDn = if showOverlay and conDoTrend then high else na;
plot cciTrdTop = if showOverlay and cciTop then high else na;
plot cciTrdBot = if showOverlay and cciBot then low else na;

ConSigUp.SetDefaultColor(Color.GREEN);
conTrdUp.SetDefaultColor(Color.GREEN);
ConSigDn.SetDefaultColor(Color.RED);
conTrdDn.SetDefaultColor(Color.RED);
cciSigTop.SetDefaultColor(Color.MAGENTA);
cciTrdTop.SetDefaultColor(Color.MAGENTA);
cciSigBot.SetDefaultColor(Color.CYAN);
cciTrdBot.SetDefaultColor(Color.CYAN);
ConSigUp.SetPaintingStrategy(PaintingStrategy.POINTS);
ConSigDn.SetPaintingStrategy(PaintingStrategy.POINTS);
conTrdUp.SetPaintingStrategy(PaintingStrategy.POINTS);
conTrdDn.SetPaintingStrategy(PaintingStrategy.POINTS);
cciSigTop.SetPaintingStrategy(PaintingStrategy.SQUARES);
cciSigBot.SetPaintingStrategy(PaintingStrategy.SQUARES);
cciTrdTop.SetPaintingStrategy(PaintingStrategy.SQUARES);
cciTrdBot.SetPaintingStrategy(PaintingStrategy.SQUARES);

#// Plots:
plot dmiHis = if showDMI then mDMI else na;  # 'DMI Histogram', colDMI, 4, PH, display=showDMI)
plot dmiLine = if showDMI then mDMI else na; # 'DMI', CGRAY, display=showDMI)
plot cciP = if showCCI then uCCI else na;    # 'CCI+', colCCI, 2, PH, false,+100, display=showCCI)
plot cciN = if showCCI then lCCI else na;    # 'CCI-', colCCI, 2, PH, false,-100, display=showCCI)
plot cciL = if showCCI then CCI else na;     # 'CCI', #BBFFFF, 2, display=showCCI)
plot zero = if !last and showLVL then 0 else na; # 'LVL0', CGRAY, display=showLVL)
plot h1 = if !last and showCCI then 100 else na; #, "100", CGRAY, display = showCCI)
plot h2 = if !last and showCCI then -100 else na; #, "100", CGRAY, display = showCCI)

dmiHis.SetLineWeight(3);
cciP.SetLineWeight(2);
cciN.SetLineWeight(2);
cciL.SetLineWeight(2);
zero.SetStyle(Curve.SHORT_DASH);
h1.SetStyle(Curve.SHORT_DASH);
h2.SetStyle(Curve.SHORT_DASH);
dmiHis.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
dmiHis.AssignValueColor(if colDMI>0 then Color.GREEN else
                        if colDMI<0 then Color.RED else Color.GRAY);
dmiLine.SetDefaultColor(Color.GRAY);
AddCloud(cciP, h1, Color.MAGENTA, Color.CURRENT);
AddCloud(h2, cciN, Color.YELLOW, Color.CURRENT);
cciP.AssignValueColor(if colCCI>0 then Color.MAGENTA else
                      if colCCI<0 then Color.YELLOW else Color.GRAY);
cciN.AssignValueColor(if colCCI>0 then Color.MAGENTA else
                      if colCCI<0 then Color.YELLOW else Color.GRAY);
cciL.SetDefaultColor(Color.VIOLET);
zero.SetDefaultColor(Color.GRAY);
h1.SetDefaultColor(Color.GRAY);
h2.SetDefaultColor(Color.GRAY);

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

#-- ENd of CODE
 

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