need help finishing a code on trending stock scan

Hi , anyone can help me finish the code on the watchlist column.


So i'm assuming if a stock intraday high is 4% higher than open, it's likely to trend up higher.
and if stock low is 4% lower than open it's likely to trend lower.

How i make a scan on my watch list to



Code:
input threshold = 4;

def trendup  = ((high - open)/open)*100 ;
def trenddn = ((open-low)/low)*100 ;

wants to do something like the column
produce 3 scenarios of
1. trend up if trendup > threshold
2. trend down if trenddn>threshold
3. NA if stock did not meet threshold, meaning the price is within 4% move.

thank u
 
Solution
Hi , anyone can help me finish the code on the watchlist column.


So i'm assuming if a stock intraday high is 4% higher than open, it's likely to trend up higher.
and if stock low is 4% lower than open it's likely to trend lower.

How i make a scan on my watch list to



Code:
input threshold = 4;

def trendup  = ((high - open)/open)*100 ;
def trenddn = ((open-low)/low)*100 ;

wants to do something like the column
produce 3 scenarios of
1. trend up if trendup > threshold
2. trend down if trenddn>threshold
3. NA if stock did not meet threshold, meaning the price is within 4% move.

thank u

your statement is confusing.
...make a scan on my watchlist...

don't know if you want a scan or column code.
you mentioned scan first...
Hi , anyone can help me finish the code on the watchlist column.


So i'm assuming if a stock intraday high is 4% higher than open, it's likely to trend up higher.
and if stock low is 4% lower than open it's likely to trend lower.

How i make a scan on my watch list to



Code:
input threshold = 4;

def trendup  = ((high - open)/open)*100 ;
def trenddn = ((open-low)/low)*100 ;

wants to do something like the column
produce 3 scenarios of
1. trend up if trendup > threshold
2. trend down if trenddn>threshold
3. NA if stock did not meet threshold, meaning the price is within 4% move.

thank u

your statement is confusing.
...make a scan on my watchlist...

don't know if you want a scan or column code.
you mentioned scan first, so i'm guessing scan...


try adding this to the end of your study

Code:
plot z = if ( trendup > threshold or 
absvalue(trenddn) > threshold) then 1 else 0;
 
Solution

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

Hi can you please help me modify the code further.🙏
I'm working in to use in a watchlist column

The idea is to buy this kind of dip after or short the pop after a mass panic .
image.png


I have added in $3 move run as an assumption of a trend for stock price between $60 to $422725

I want only results that are at the vwap right now, i assume it's 0.8% for stock price below $60.
and $0.3 for stock price above $60.

Keep getting no result.

Code:
#trend signal
input perc_threshold = 4;
input dollar_threshold = 3 ;

def trendup  = ((high - open)/open)*100 ;
def trenddn = ((open-low)/low)*100 ;
def dollartrendup = (high-open);
def dollartrenddn = (open-low);


#vwap distance
input vwap_percent = 0.8;
input vwap_dollar = 0.3;
input price   = close;
def   VWAP    = reference VWAP();


plot z = if ( trendup > perc_threshold and between(price, VWAP - 1 * (vwap_percent/100), VWAP + 1 * (vwap_percent/100))
 or

absvalue(trenddn) > perc_threshold) and between(price, VWAP - 1 * (vwap_percent/100), VWAP + 1 * (vwap_percent/100))

or

close >60 and dollartrendup>dollar_threshold and between(price, vwap_dollar, VWAP + vwap_dollar)

or
close < 60 and absvalue(dollartrenddn) > dollar_threshold and  between(price, vwap_dollar, VWAP + vwap_dollar)

then 1 else 0;
 ;
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
454 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