The Power Shift Indicator – Hubert Senters ADX Chart Setup For ThinkOrSwim

theLEMband

Member
VIP
Despite the hype, this is nothing more than a simple ADX/DMI histogram.
FufYm2y.png

The Average Directional Index (ADX) and Directional Movement Index (DMI) can be used to identify trends and make trading decisions:
  • Identify trends
    The ADX measures the strength of a trend, with values above 25 indicating a strong trend and values below 20 indicating a weak trend.
  • Generate trade signals
    Crossovers of the +DI and -DI lines can indicate potential trade signals:
    • When the +DI crosses above the -DI, it could signal a buy if the ADX is above 25.
    • When the -DI crosses above the +DI, it could signal a sell if the ADX is above 25.
  • Identify breakouts
    The ADX can help identify valid breakouts by showing when it's strong enough for prices to continue trending after the breakout.
  • Identify contraction periods
    When the +DI and -DI lines move close together, it indicates a contraction in volatility. These are often followed by periods of larger, trending movement.
  • Consider the DMI's relative strength
    The relative strength of the DMI's peaks can indicate the momentum of price. For example, a series of rising +DMI peaks that remain above the -DMI for extended periods of time indicates a strong uptrend.
The DMI's default period is usually 14 periods, but traders can modify this to suit their needs. Shortening the period makes the indicator more sensitive, while lengthening it makes it less reactive to price fluctuations.

The ADX/DMI indicator can be susceptible to creating false signals, so it's best to use it in conjunction with other forms of analysis

Ruby:
#this is my guess at Hubert Senters Powershift indicator

declare lower;

input length = 14;
input ADXLevel = 20;
input averageType = AverageType.WILDERS;
input alerts = yes;

def hiDiff = high - high[1];
def loDiff = low[1] - low;

def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM =  if loDiff > hiDiff and loDiff > 0 then loDiff else 0;

def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
def diPlus = 100 * MovingAverage(averageType, plusDM, length) / ATR;
def diMinus = 100 * MovingAverage(averageType, minusDM, length) / ATR;
plot "DI+" = if diPlus > 20 then diPlus else Double.NaN ;
plot "DI-" = if diMinus > 20 then diMinus else Double.NaN;

def DX = if (diPlus + diMinus > 0) then 100 * AbsValue(diPlus - diMinus) / (diPlus + diMinus) else 0;
plot ADXCalc = MovingAverage(averageType, DX, length);
#plot ADX = if ADXCalc > ADXLevel then ADXCalc else Double.NaN;
plot triggerline = ADXLevel;

Alert(alerts and ADXCalc crosses above ADXLevel, " ", Alert.BAR, Sound.Ring);
Alert(alerts and ADXCalc > ADXLevel and "DI+" crosses "DI-", " ", Alert.BAR, Sound.Ring);

"DI+".SetDefaultColor(GetColor(1));
"DI+".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
"DI+".SetDefaultColor(Color.GREEN);
"DI-".SetDefaultColor(GetColor(8));
"DI-".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
"DI-".SetDefaultColor(Color.RED);
ADXCalc.DefineColor("Trending", Color.YELLOW);
ADXCalc.DefineColor("NonTrending", Color.GRAY);
ADXCalc.AssignValueColor(if ADXCalc >= 20 then ADXCalc.Color("Trending") else ADXCalc.Color("NonTrending"));
ADXCalc.SetLineWeight(2);
triggerline.SetDefaultColor(Color.WHITE);
 
Last edited by a moderator:
I don't think this would violate any copyright terms, as it is just my guess at the indicator. A moderator can let me know if that is incorrect.

Ruby:
#this is my guess at Hubert Senters Powershift indicator

declare lower;

input length = 14;
input ADXLevel = 20;
input averageType = AverageType.WILDERS;
input alerts = yes;

def hiDiff = high - high[1];
def loDiff = low[1] - low;

def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM =  if loDiff > hiDiff and loDiff > 0 then loDiff else 0;

def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
def diPlus = 100 * MovingAverage(averageType, plusDM, length) / ATR;
def diMinus = 100 * MovingAverage(averageType, minusDM, length) / ATR;
plot "DI+" = if diPlus > 20 then diPlus else Double.NaN ;
plot "DI-" = if diMinus > 20 then diMinus else Double.NaN;

def DX = if (diPlus + diMinus > 0) then 100 * AbsValue(diPlus - diMinus) / (diPlus + diMinus) else 0;
plot ADXCalc = MovingAverage(averageType, DX, length);
#plot ADX = if ADXCalc > ADXLevel then ADXCalc else Double.NaN;
plot triggerline = ADXLevel;

Alert(alerts and ADXCalc crosses above ADXLevel, " ", Alert.BAR, Sound.Ring);
Alert(alerts and ADXCalc > ADXLevel and "DI+" crosses "DI-", " ", Alert.BAR, Sound.Ring);

"DI+".SetDefaultColor(GetColor(1));
"DI+".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
"DI+".SetDefaultColor(Color.GREEN);
"DI-".SetDefaultColor(GetColor(8));
"DI-".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
"DI-".SetDefaultColor(Color.RED);
ADXCalc.DefineColor("Trending", Color.YELLOW);
ADXCalc.DefineColor("NonTrending", Color.GRAY);
ADXCalc.AssignValueColor(if ADXCalc >= 20 then ADXCalc.Color("Trending") else ADXCalc.Color("NonTrending"));
ADXCalc.SetLineWeight(2);
triggerline.SetDefaultColor(Color.WHITE);
great job! thank you @theLEMband , quick question, do you think will be passible to color the candles meaning if is a bullish cross to pain the candles green and red for bearish cross? thanks in advance
 
great job! thank you @theLEMband , quick question, do you think will be passible to color the candles meaning if is a bullish cross to pain the candles green and red for bearish cross? thanks in advance
It is possible. I just copied the code from the DMI oscillator, which already colors the candles and modified it slightly.

Ruby:
declare lower;

input length = 14;
input ADXLevel = 20;
input averageType = AverageType.WILDERS;
input paintBars = yes;
input alerts = yes;

def hiDiff = high - high[1];
def loDiff = low[1] - low;

def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM =  if loDiff > hiDiff and loDiff > 0 then loDiff else 0;

def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
def diPlus = 100 * MovingAverage(averageType, plusDM, length) / ATR;
def diMinus = 100 * MovingAverage(averageType, minusDM, length) / ATR;
plot "DI+" = if diPlus > 20 then diPlus else Double.NaN ;
plot "DI-" = if diMinus > 20 then diMinus else Double.NaN;

def DX = if (diPlus + diMinus > 0) then 100 * AbsValue(diPlus - diMinus) / (diPlus + diMinus) else 0;
plot ADXCalc = MovingAverage(averageType, DX, length);
#plot ADX = if ADXCalc > ADXLevel then ADXCalc else Double.NaN;
plot triggerline = ADXLevel;

Alert(alerts and ADXCalc crosses above ADXLevel, " ", Alert.BAR, Sound.Ring);
Alert(alerts and ADXCalc > ADXLevel and "DI+" crosses "DI-", " ", Alert.BAR, Sound.Ring);

"DI+".SetDefaultColor(GetColor(1));
"DI+".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
"DI+".SetDefaultColor(Color.GREEN);
"DI-".SetDefaultColor(GetColor(8));
"DI-".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
"DI-".SetDefaultColor(Color.RED);
ADXCalc.DefineColor("Trending", Color.YELLOW);
ADXCalc.DefineColor("NonTrending", Color.GRAY);
ADXCalc.AssignValueColor(if ADXCalc >= 20 then ADXCalc.Color("Trending") else ADXCalc.Color("NonTrending"));
ADXCalc.SetLineWeight(2);
triggerline.SetDefaultColor(Color.WHITE);

DefineGlobalColor("Positive", Color.UPTICK);
DefineGlobalColor("Negative", Color.DOWNTICK);
AssignPriceColor(if !paintBars
    then Color.CURRENT
    else if diPlus > diMinus
        then GlobalColor("Positive")
        else GlobalColor("Negative"));
 
Another question. The lines are behind the candles. Anyway to make them in front of them? Thanks

No, this is not correct.

The candles that we so desperately want to see, are plotted underneath everything.
The lines, clouds, and all other plotting elements are placed in front of the candles.
There is no workaround. 😖
 

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