Try thisHow would you create a percent change label for a different symbol such as SPY that would track the change since the market open? Thus, it would not include the percent change from the previous day, just from the open.
Ruby:def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1]; def PercentChg = 100 * (close / o - 1); AddLabel(1, " Percent Chg from open: " + close + " / " + o + " = " + PercentChg + "%", if close > o then Color.GREEN else Color.RED);
Try thisHow would you create a percent change label for a different symbol such as SPY that would track the change since the market open? Thus, it would not include the percent change from the previous day, just from the open.
Ruby:def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1]; def PercentChg = 100 * (close / o - 1); AddLabel(1, " Percent Chg from open: " + close + " / " + o + " = " + PercentChg + "%", if close > o then Color.GREEN else Color.RED);
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Put this in a custom column editor. I have set the percentage change to absolute value and rounded, as the background color of green/red will indicate whether it is positive/negative.Perfect and you could tell us how to put it on the watchlist, thank you very much, sorry my English
Ruby:def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1]; def PercentChg = 100 * (close / o - 1); AddLabel(1, absValue(round(PercentChg)) , color.black); assignbackgroundColor(if close > o then Color.GREEN else Color.RED);
As said is there any way to create a script that scans for stocks above or x percent near the open (on the daily)
input x = 98 ;
def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1];
def PercentChg = 100 * (close / o - 1);
plot scan = PercentChg > x ;
Hi,
maybe someone can help me since i am not ut in writing scruipt. I would like to know how far the current price is from the DailyOpen in percent. Similar to my picture where I see how far the short is from the EMA.
![]()
def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1];
plot PercentChg = round(100 * (close / o - 1),1);
Start a new thread and receive assistance from our community.
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.
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.