Watchlist column-Breaking Pre market high

Kitten-massacre

New member
What I’m wanting is to have a watchlist column that tells me how much higher the price is currently at compared to that mornings pre market high.

If pre market high was $3.50, and the price at market open shoots to $7, then the watchlist column would read 200 (%). If the price drops to 1.25, then it would read 50. If it stayed at 3.50 it would read 100..this is how I’m assuming it would look anyway. I’d just like to at a glance quickly reference if the stock on my watchlist is over pre market high or not. Thank you to any who try to help!
 
Solution
What I’m wanting is to have a watchlist column that tells me how much higher the price is currently at compared to that mornings pre market high.

If pre market high was $3.50, and the price at market open shoots to $7, then the watchlist column would read 200 (%). If the price drops to 1.25, then it would read 50. If it stayed at 3.50 it would read 100..this is how I’m assuming it would look anyway. I’d just like to at a glance quickly reference if the stock on my watchlist is over pre market high or not. Thank you to any who try to help!


watchlist

compare daytime close prices to premarket highest high
(also calcs the lowest low)

zprehi
http://tos.mx/mKXqRtj

Code:
# zprehi
# pre_hilo_compare...
What I’m wanting is to have a watchlist column that tells me how much higher the price is currently at compared to that mornings pre market high.

If pre market high was $3.50, and the price at market open shoots to $7, then the watchlist column would read 200 (%). If the price drops to 1.25, then it would read 50. If it stayed at 3.50 it would read 100..this is how I’m assuming it would look anyway. I’d just like to at a glance quickly reference if the stock on my watchlist is over pre market high or not. Thank you to any who try to help!


watchlist

compare daytime close prices to premarket highest high
(also calcs the lowest low)

zprehi
http://tos.mx/mKXqRtj

Code:
# zprehi
# pre_hilo_compare

#https://usethinkscript.com/threads/watchlist-column-breaking-pre-market-high.16341/

def bn = BarNumber();
def na = Double.NaN;

def newday = getday() != getday()[1];

# open/close times  (EST)
input start = 0930;
input end = 1600;

def pre = if secondsfromTime(00) >= 0 and secondstillTime(start) > 0 then 1 else 0;
def daytime = if secondsfromTime(start) >= 0 and secondstillTime(end) > 0 then 1 else 0;

def prehi;
def prelo;
if bn == 1 then {
 prehi = 0;
 prelo = 0;
} else if (prehi[1] == 0 or !pre[1]) and pre then {
 prehi = high;
 prelo = low;
} else if pre then {
 prehi = max(prehi[1], high);
 prelo = min(prelo[1], low);
} else {
 prehi = prehi[1];
 prelo = prelo[1];
}

def hiper = if daytime and prehi > 0 then round(100*close/prehi,1) else hiper[1];
def loper = if daytime and prelo > 0 then round(100*close/prelo,1) else loper[1];

#addlabel(1, (hiper + " %"), (if hiper >= 100 then color.green else color.red));
#addlabel(1, (hiper + " %"), color.black);

plot z = hiper;
z.SetDefaultColor(Color.black);

AssignBackgroundColor((if hiper >= 100 then color.green else color.red));

#

gQBUMd5.jpg
 
Solution

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