Projection indicator high and low

Drmoh1800

Member
I have a new idea where we would look back at 20 bars for examples to analyze the highs and lows, measure the difference, and then project equal potential moves both upward and downward based on this range. I'm not sure if this is feasible, though.or not . Thanks in advance .
Lets make it certain time window 9 to 9:30 can be adjusted if needed . Projection is good for end of the day .
 

Attachments

  • IMG_6078.jpeg
    IMG_6078.jpeg
    252.2 KB · Views: 49
Solution
I have a new idea where we would look back at 20 bars for examples to analyze the highs and lows, measure the difference, and then project equal potential moves both upward and downward based on this range. I'm not sure if this is feasible, though.or not . Thanks in advance .
Lets make it certain time window 9 to 9:30 can be adjusted if needed . Projection is good for end of the day .
your description is too vague

i made some guesses and made this

go back 2 bars,
then look back 20 bars and find the highest and lowest
calc the difference. apply multiplier to this
find the center of current bar
center the hi-lo range around the current bar
draw lines from last bar


how many bars back from current bar to start looking for...
I have a new idea where we would look back at 20 bars for examples to analyze the highs and lows, measure the difference, and then project equal potential moves both upward and downward based on this range. I'm not sure if this is feasible, though.or not . Thanks in advance .
Lets make it certain time window 9 to 9:30 can be adjusted if needed . Projection is good for end of the day .
your description is too vague

i made some guesses and made this

go back 2 bars,
then look back 20 bars and find the highest and lowest
calc the difference. apply multiplier to this
find the center of current bar
center the hi-lo range around the current bar
draw lines from last bar


how many bars back from current bar to start looking for highs and lows
input set_back = 2;

over how many bars to look for a highest and lowest
input bars_back = 20;

a multiplier applied to highest-lowest range
input range_factor = 1.0;


Code:
#bars_back_hilorng
#https://usethinkscript.com/threads/projection-indicator-high-and-low.20856/

def na = double.nan;
def bn = barnumber();

def lastbn = HighestAll(If(IsNaN(close), 0, bn));
def lastbar = if (bn == lastbn) then 1 else 0;

#def lastbar = !isnan(close[0]) and isnan(close[-1]);
#def last_close = highestall(if lastbar then close else 0);

input set_back = 2;
input bars_back = 20;
input range_factor = 1.0;

def hi = Highest(high[set_back], bars_back);
def lo = Lowest(low[set_back], bars_back);
def rng = range_factor * (hi-lo);

def mid = (high+low)/2;

# save line data on last bar
def hi2 = if bn == 1 then 0
# else if !isnan(close) and isnan(close) then mid + rng/2
 else if lastbar then mid + rng/2
 else hi2[1];

def lo2 = if bn == 1 then 0
# else if !isnan(close) and isnan(close) then mid - rng/2
 else if lastbar then mid - rng/2
 else lo2[1];

#plot zhi = if hi2 > 0 then hi2 else na;
#plot zlo = if lo2 > 0 then lo2 else na;
plot zhi = if (bn >= (lastbn-0)) and (bn <= (lastbn+2)) then hi2 else na;
plot zlo = if (bn >= (lastbn-0)) and (bn <= (lastbn+2)) then lo2 else na;
zhi.setdefaultcolor(color.cyan);
zlo.setdefaultcolor(color.cyan);
#
 
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
314 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