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

theLEMband

Member
VIP
hello group.. a quick question , i am looking for this indicator from Hubert Senters, the Power Shift indicator. the someone in the group have the code for it? thanks in advance.
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);
 

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

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"));
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
308 Online
Create Post

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