exceed 50% of daily ATR within first 15 to 30 minutes of open

yahalomi3

New member
Hello to everyone, I'm trying to get an alert / create a scanner that scans for stocks that exceeds 50% percent of its daily ATR within 15 to 30 minutes of the opening (up or down) let me know if something like that exists
Thanks
 
Solution
This should get you going. I don't have it set to go all time based for alerts, but it has most of the pieces in place. Good luck!

Code:
declare upper;

input ATR_Lookback = 30;
input ATR_Multiplier = 0.50;


def ATR_day = MovingAverage(AverageType.WILDERS, TrueRange(high(period = AggregationPeriod.DAY), close(period = AggregationPeriod.DAY), low(period = AggregationPeriod.DAY)), ATR_Lookback);

def opening = if secondsFromTime(0930) >= 0 and secondsFromTime(0930)[1] < 0 then open else opening[1];

plot day_open = opening;
plot day_minus_one_atr_lower = opening - (ATR_Day * ATR_Multiplier);
plot day_plus_one_atr_higher = opening + (ATR_Day * ATR_Multiplier);

day_open.SetPaintingStrategy(PaintingStrategy.HORIZONTAL)...
This should get you going. I don't have it set to go all time based for alerts, but it has most of the pieces in place. Good luck!

Code:
declare upper;

input ATR_Lookback = 30;
input ATR_Multiplier = 0.50;


def ATR_day = MovingAverage(AverageType.WILDERS, TrueRange(high(period = AggregationPeriod.DAY), close(period = AggregationPeriod.DAY), low(period = AggregationPeriod.DAY)), ATR_Lookback);

def opening = if secondsFromTime(0930) >= 0 and secondsFromTime(0930)[1] < 0 then open else opening[1];

plot day_open = opening;
plot day_minus_one_atr_lower = opening - (ATR_Day * ATR_Multiplier);
plot day_plus_one_atr_higher = opening + (ATR_Day * ATR_Multiplier);

day_open.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
day_minus_one_atr_lower.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
day_plus_one_atr_higher.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

day_open.SetDefaultColor(color.gray);
day_minus_one_atr_lower.SetDefaultColor(color.red);
day_plus_one_atr_higher.SetDefaultColor(color.green);

AddVerticalLine(secondsFromTime(1000) == 0, "half-hour mark", color.plum);

plot exceeded_upward = if close crosses above day_plus_one_atr_higher then low else double.nan;
plot exceeded_downward = if close crosses below day_minus_one_atr_lower then high else double.nan;

exceeded_upward.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
exceeded_upward.SetDefaultColor(color.green);
exceeded_downward.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
exceeded_downward.SetDefaultColor(color.red);

-mashume
 
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
253 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