Average up move of a stock

jeffc

New member
I am looking for an indicator that shows the average up move in dollars over the last 90 days between 6:30am-6:45am pacific time at market open. Thank you.
 
Solution
I am looking for an indicator that shows the average up move in dollars over the last 90 days between 6:30am-6:45am pacific time at market open. Thank you.

This uses a 15m agg bar and is dependent on the number of days showing on the chart. I had to use a 180 days chart timeframe to get 90 days of data.

Capture.jpg
Code:
def ymd = GetYYYYMMDD();
def ok           = !IsNaN(close);
def capture      = ok and ymd != ymd[1];
def dayCount     = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay      = (HighestAll(dayCount) - dayCount) + 1;

input days       = 90;

input start_time = 0930; #Allows the first candle to form befor determining direction

def start = if SecondsTillTime(start_time) == 0 and...
I am looking for an indicator that shows the average up move in dollars over the last 90 days between 6:30am-6:45am pacific time at market open. Thank you.

do you want,
the average of each days price difference from,

1. 9:30 open to 9:45 close
or
2. the lowest price during the first 15 minutes subtracted from the highest price during the first 15 minutes?
 

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

I am looking for an indicator that shows the average up move in dollars over the last 90 days between 6:30am-6:45am pacific time at market open. Thank you.

This uses a 15m agg bar and is dependent on the number of days showing on the chart. I had to use a 180 days chart timeframe to get 90 days of data.

Capture.jpg
Code:
def ymd = GetYYYYMMDD();
def ok           = !IsNaN(close);
def capture      = ok and ymd != ymd[1];
def dayCount     = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0);
def thisDay      = (HighestAll(dayCount) - dayCount) + 1;

input days       = 90;

input start_time = 0930; #Allows the first candle to form befor determining direction

def start = if SecondsTillTime(start_time) == 0 and SecondsFromTime(start_time) == 0
            then 1
            else 0;
def l = if start and thisDay <= Min(HighestAll(thisDay), days) then l[1] + low(period = AggregationPeriod.FIFTEEN_MIN) else l[1];
def h = if start and thisDay <= Min(HighestAll(thisDay), days) then h[1] + high(period = AggregationPeriod.FIFTEEN_MIN) else h[1];

def up = (h - l);
AddLabel(1, Min(HighestAll(thisDay), days) + " Days Avg Up Move (0630-0645 PT): " + AsDollars(up / Min(HighestAll(thisDay), days)) , Color.LIGHT_GREEN);
AddLabel(1, "| Highs: " + AsDollars(h) + " | Lows: " + AsDollars(l) + " | Diff: " + AsDollars(h - l), Color.WHITE);

#Testing#
input test = yes;
AddChartBubble(test and SecondsFromTime(0930) == 0, low - .1, high + "\n" + open + "\n" + (high - open) + "\nSum Highs " + AsDollars(h) + "\nSum Lows " + AsDollars(l) + "\nDays " + (thisDay ), Color.GRAY);
 
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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