5% premarket gap; on yesterday move of 10%

riplies24

New member
Need a scan built with these requirements:(seems simple, but I cant seem to figure it out)
previousdayclose >= previousdayclose by 10% or more
previousdayclose *1.05

To be clear, I want to scan premarket for any gaps of 5% or more, BUT only on stocks that had gained 10% or more yesterday, than the day before close.

I have found several versions of the gap up on the current day that work fine, but requiring the stocks to have made a 10% move the day before is what I have not been able to find.

Thanks you for any help!
 
Solution
@riplies24
See how this works for you. It will update on the first bar plotted on or after the Market_Open input time.
Scan for the plot being 'true';
Ruby:
input Market_Open = 0400;
input Market_Close = 1600;
input PreMarket_Percent_Gap = 5;
input Previous_Close_Percent_Gap = 10;

def PreMarketOpen = if (SecondsTillTime(Market_Open)[1] > 0 and SecondsTillTime(Market_Open) <= 0)
                    or (SecondsTillTime(Market_Open)[1] < SecondsTillTime(Market_Open))
                    then Round(open,2)
                    else PreMarketOpen[1];

def DayClose = if (SecondsTillTime(Market_Close)[1] > 0 and SecondsTillTime(Market_Close) <= 0)
                or ((SecondsTillTime(Market_Close)[1] < SecondsTillTime(Market_Close)) and...
@riplies24
See how this works for you. It will update on the first bar plotted on or after the Market_Open input time.
Scan for the plot being 'true';
Ruby:
input Market_Open = 0400;
input Market_Close = 1600;
input PreMarket_Percent_Gap = 5;
input Previous_Close_Percent_Gap = 10;

def PreMarketOpen = if (SecondsTillTime(Market_Open)[1] > 0 and SecondsTillTime(Market_Open) <= 0)
                    or (SecondsTillTime(Market_Open)[1] < SecondsTillTime(Market_Open))
                    then Round(open,2)
                    else PreMarketOpen[1];

def DayClose = if (SecondsTillTime(Market_Close)[1] > 0 and SecondsTillTime(Market_Close) <= 0)
                or ((SecondsTillTime(Market_Close)[1] < SecondsTillTime(Market_Close)) and !PreMarketOpen)
                    then Round(close[1],2)
                    else DayClose[1];

def _1DayAgoClose;
def _2DayAgoClose;

if (SecondsTillTime(Market_Open)[1] > 0 and SecondsTillTime(Market_Open) <= 0)
    or (SecondsTillTime(Market_Open)[1] < SecondsTillTime(Market_Open)) {                
_1DayAgoClose = DayClose;
_2DayAgoClose = _1DayAgoClose[1];
}else{
_1DayAgoClose = _1DayAgoClose[1];
_2DayAgoClose = _2DayAgoClose[1];
}

plot _10_5_PercentUpGap = ((_1DayAgoClose - _2DayAgoClose) / _2DayAgoClose > (Previous_Close_Percent_Gap/100))
                          and(((PreMarketOpen - _1DayAgoClose) / _1DayAgoClose) > (PreMarket_Percent_Gap/100))
and _1DayAgoClose > 0
                          and _2DayAgoClose > 0;
_10_5_PercentUpGap.Hide();

addchartbubble((SecondsTillTime(Market_Open)[1] > 0 and SecondsTillTime(Market_Open) <= 0)
                or (SecondsTillTime(Market_Open)[1] < SecondsTillTime(Market_Open)), high,
                "PM open " + PreMarketOpen + "  " +
                Round((((PreMarketOpen - _1DayAgoClose) / _1DayAgoClose)*100),1) + "% up"
                + "\n" + "1 Day Ago Close " + _1DayAgoClose + "  " +
                Round((((_1DayAgoClose - _2DayAgoClose) / _2DayAgoClose)*100),1) + "% up"
                + "\n" + "2 Day Ago Close " + _2DayAgoClose,
                if _10_5_PercentUpGap then color.green
                else color.white);
 
Last edited:
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
441 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