Highest Point on each Intraday

cheual

New member
I'd like to create a simple script that'll have a point @ close at the HIGHEST point of each intraday everyday on my screen.

Can someone help with creation of this script.

Thank You!
 
I'd like to create a simple script that'll have a point @ close at the HIGHEST point of each intraday everyday on my screen.

Can someone help with creation of this script.

Thank You!


@cheual Per your request here is your high during regular trading hours study being plotted on your charts. Remember to run this at intraday aggregations, e.g. 15 mins, etc

Code:
# High RTH
# tomsk
# 1.6.2020

declare hide_on_daily;

def active = GetTime() >= RegularTradingStart(GetYYYYMMDD());
def H = if active and !active[1]
        then high
        else if active and high > H[1]
             then high
             else H[1];
def Hbn = if high == H then barNumber() else Double.NaN;
plot HLine = if barNumber() >= HighestAll(Hbn) then H else Double.NaN;
HLine.SetDefaultColor(Color.Yellow);
# High RTH
 

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

Well that's because you were not clear when you initiated that request. That would be a different code. Next time be real explicit
Here is the high previous day - run this on an intraday aggregation, e.g. 15 min

Code:
# High Previous Day
# tomsk
# 1.7.2020

declare hide_on_daily;

def active = GetTime() >= RegularTradingStart(GetYYYYMMDD());
plot PH = if active then high(period = AggregationPeriod.Day)[1] else Double.NaN;
PH.SetLineWeight(2);
PH.SetDefaultColor(Color.Yellow);
# End High Previous Day
 
Last edited:
Hi @tomsk, I was hoping that maybe you could help me on a similar task if possible. I'm trying to define the highest point before the MACD cross. (indicated with the two red arrows). Ultimately I will add the ATR value to that point to determine my stop loss.

eMAb4Hv.png
 
Lets say im scanning the last 20 bars to find the highest close and it just so happens to be in the 7th candle counting from the right. how do I get the bar number of that particular candle
 
Lets say im scanning the last 20 bars to find the highest close and it just so happens to be in the 7th candle counting from the right. how do I get the bar number of that particular candle

Defines the Barnumber of the Highest CLOSE of the last XYZ bars
Code:
#Defines the Barnumber of the Highest CLOSE of the last XYZ bars
#By XeoNoX Via Usethinkscript.com
input barsago = 20;
def hc = highest(close,barsago);
def hcBar = if high == hc then BarNumber() else hcbar[1];
def scan = hcbar;
AddLabel (yes, " Barnumber of the Highest Close of the last " + barsago + " bars is Bar# " +  (scan)  );
 
Defines the Barnumber of the Highest CLOSE of the last XYZ bars
Code:
#Defines the Barnumber of the Highest CLOSE of the last XYZ bars
#By XeoNoX Via Usethinkscript.com
input barsago = 20;
def hc = highest(close,barsago);
def hcBar = if high == hc then BarNumber() else hcbar[1];
def scan = hcbar;
AddLabel (yes, " Barnumber of the Highest Close of the last " + barsago + " bars is Bar# " +  (scan)  );
Could you also make another part of code that takes the lowest close that comes after the highest close and calculates the percentage difference for example be at least 5%and also take that same lowest point that comes after the high and make sure its greater than the open of the first bar from the left (i dont know from where bar numbers are counted). and could it also be possible to check for this pattern in range of time frames lets say the last 10 to 20 bars?
 
Last edited:
you got me there buddy, although possible the amount of time it would take me would be a few days, maybe someone else can code that for you more efficiently. btw you are going to have to define "first bar from the left " better as in the first bar from the left of what?
 
you got me there buddy, although possible the amount of time it would take me would be a few days, maybe someone else can code that for you more efficiently. btw you are going to have to define "first bar from the left " better as in the first bar from the left of what?
The last bar counting from the current bar I mean
 
you got me there buddy, although possible the amount of time it would take me would be a few days, maybe someone else can code that for you more efficiently. btw you are going to have to define "first bar from the left " better as in the first bar from the left of what?
could you make this code work in multiple ranges instead of just 21? maybe just 10 to 20? I could make a new scanner for every time frame but the emails would be over whelming

Code:
input length = 21;
input pct=1.8;



def corr=1+(pct/100);
def lastbar = if IsNaN(close[-1]) and !IsNaN(close) then BarNumber() else lastbar[1];
def from = (HighestAll(lastbar) - length);

def hi = if BarNumber() >= (HighestAll(lastbar) - length) and high > hi[1] then high else hi[1];
def hibar = if BarNumber() > (HighestAll(lastbar) - length) and high == hi then BarNumber() else hibar[1];

def lo = if BarNumber() > (HighestAll(hibar)) and  lo[1] == 0 then low else if BarNumber() > (HighestAll(hibar)) and low < lo[1] then low else lo[1];

def fhi=if !IsNaN(close) then high[20] else fhi[1];
def con= hi/lo>=corr and lo>0 and lo>fhi ;
plot scan=con;
 
i dont make the rules or actions, thats something youde have to limit based of rules to your scan.
and FYI if you were to add more ranges at different time frames as you were suggesting in post #11 youre just going to get even more emails
last but not least the code you have as
def from = (HighestAll(lastbar) - length);
isnt required
 
i assume what you mean is your trying to use the AND feature as in the same scan is true under the 1 min 2 min 5 min etc, you can add them manually to each time frame to also filter those specific time frames you want... just add the code again and select the timeframe.

OFPrhkn.png
 
i assume what you mean is your trying to use the AND feature as in the same scan is true under the 1 min 2 min 5 min etc, you can add them manually to each time frame to also filter those specific time frames you want... just add the code again and select the timeframe.

OFPrhkn.png
no I mean different ranges like 10 bars ago. 11 bars ago 12 bars ago etc. right now the script scans the last 21 bars for the pattern. I could make a bunch of scanners individually from 10 all the way to 20 but like I said before it would alot of emails as there's will be repeats
 
If I did that wouldn't it only output tickers that qualify for all of the time frames?
yes that sounds like what you wanted because i mentioned in a earlier post in post #14 if you did them separate scans you would get more emails. so it sounded like you wanted them all in one scan and for all of them to be true under different time frames. so i explained how to do it.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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