Z-Score Upper Indicator for ThinkorSwim

Example of indicator triggering premarket suggesting bullish day. It turned out correct.
4348MHm.png
Hello - have you noticed this arrow is accurate when it shows up premarket in more examples than these? Looks like there are usually a few on the 5 minute chart.. where should we be looking for this arrow PM to show the direction - 15 minute chart? @chewie76

For example, NVDA PM on 1/13 on the 15 minute chart.. you have an up arrow at 4 AM, down arrow at 8 AM, down at open and it died all day..

FYI - I took calls today.. one of my worst losses. Glad this would help me avoid that!
 
I took the standard Zscore indicator and created an upper indicator out of it that gives buy and sell signals. You can change the sensitivity by going into the code and adjusting the two conditions of -.75 and .75. A closer number to 0 will be more sensitive with more alerts and a higher number will be less sensitive. I don't suggest going over 1.

Below is a picture of ROKU on 9/22/2020 using a 2 min chart. I show the lower indicator as well. The alert is triggered when the Zscore line crosses the average line where the average line is greater than or less than .75. See circled areas. Give it a whirl.

View attachment 8044

Here is the code:

Code:
declare upper;

input price = close;
input length = 20;
input ZavgLength = 20;

#Initialize values
def oneSD = stdev(price,length);
def avgClose = simpleMovingAvg(price,length);
def ofoneSD = oneSD*price[1];
def Zscorevalue = ((price-avgClose)/oneSD);
def avgZv = average(Zscorevalue,20);

#Compute and plot Z-Score

DEF avgZscore = average(Zscorevalue,ZavgLength);
#avgZscore.setPaintingStrategy(paintingStrategy.LINE);

DEF Zscore = ((price-avgClose)/oneSD);

#Plot zero line and extreme bands
DEF zero = 0;
DEF two = 2;
DEF one = 1;
DEF negone = -1;
DEF negtwo = -2;
def three = 3;
def negthree = -3;

def condition1 = zscore crosses above avgZscore and avgzscore < -.75;
def condition2 = zscore crosses below avgZscore and avgzscore > .75;

# Plot arrows
plot UArrow = if condition1 is true then 1 else 0;
UArrow.SetDefaultColor(Color.white);
UArrow.SetPaintingStrategy(PaintingStrategy.Boolean_arrow_up);
Uarrow.setLineWeight(4);
plot DArrow = if condition2 is true then 1 else 0;
DArrow.SetDefaultColor(Color.white);
DArrow.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_DOWN);
Darrow.setLineWeight(4);
Hey my friend, what is the label on your upper chart displaying distribution?
 

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