Scan for % change since open

shahgols

New member
Hi all, I am trying to create a scan that lists stocks that have gone up 1% or more from today's open price. I found this script online, which supposedly shows the % change from the open price, but how do I change this or how do I set up a scan that will show me only stocks that have gone up 1% or more? Thanks in advance.

plot x = round(100*((close/open)-1),1);
 

XeoNoX

Well-known member
VIP
Code:
def desired_percent = 1;

def percent_from_open = round(100*((close/open)-1),1);

plot scan = percent_from_open >= desired_percent;

Appreciation goes a long way in life... Don't forget to hit the like button if you liked my post!
 
Last edited:

neil26

New member
I have the below custom indicator to show the % change since the Open for the Watchlist. However, it does not work on the mobile app. I believe this has to do with the Aggregation Period being the day, but not completely sure. Anyone know how to modify the code to get it to work on the mobile app? For anyone who doesn't have the below code, feel free to take it - it works great on TOS desktop.

%Open
Code:
def x = close / open -1 ;
Def upday = x > 0;
Def downday = x < 0;
Input DisplayX = yes;
addlabel(yes,aspercent(X),if downday then color.red else if upday then color.blue else color.yellow
);
 

rad14733

Well-known member
VIP
I have the below custom indicator to show the % change since the Open for the Watchlist. However, it does not work on the mobile app. I believe this has to do with the Aggregation Period being the day, but not completely sure. Anyone know how to modify the code to get it to work on the mobile app? For anyone who doesn't have the below code, feel free to take it - it works great on TOS desktop.

%Open
Code:
def x = close / open -1 ;
Def upday = x > 0;
Def downday = x < 0;
Input DisplayX = yes;
addlabel(yes,aspercent(X),if downday then color.red else if upday then color.blue else color.yellow
);

You aren't setting an AggregationPeriod so I doubt that is the issue... Are you sure AddLabel() is supported on Mobile...??? I don't use Mobile so I can't say whether it is or not but I know Mobile has limitations...
 

Similar threads

Top