Help on Price crosses above prev day high study

Sai

Member
VIP
Hi Experts,

Appreciate all the help you do for new comres .

I am looking to have simple study where today's price closes above prev day high , i want to get notified as arrow in chart first . I may be using that as order later.

WHich one is best to use price crosses above High[1] or close crosses above high[1] . I am not getting any signals on my chart .

i am sure someone might have come across this kind of study. Appreciate any help in this regard

1730167259965.png
 
Solution
plot Signal =
if Open < High[1] and High > High[1]
then High[1] else Double.NaN;
Signal.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
plot Signal =
if Open < High[1] and High > High[1]
then High[1] else Double.NaN;
Signal.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
 
  • Like
Reactions: Sai
Solution
Hi Experts,

Appreciate all the help you do for new comres .

I am looking to have simple study where today's price closes above prev day high , i want to get notified as arrow in chart first . I may be using that as order later.

WHich one is best to use price crosses above High[1] or close crosses above high[1] . I am not getting any signals on my chart .

i am sure someone might have come across this kind of study. Appreciate any help in this regard

View attachment 23260
This is not exactly what you're asking for but it gives dashed lines for the previous days high and or low. It is labeled Green if low and labeled Red if High and you can easily see if your candles cross the line?
Code:
##AsGood_PreviousDayHighLowClose
#Thanks to Welkin forceIndex Offset Close.

input aggregationPeriod = AggregationPeriod.DAY;
def yesterday_high = high(period = aggregationPeriod)[1];

plot static = yesterday_high;
static.AssignValueColor(color.White);
static.SetPaintingStrategy(PaintingStrategy.DASHES);

def limit = !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

plot static1 = Yesterday_High;
static1.AssignValueColor(color.White);

input bubblemover = 4;
def b = bubblemover;
def limit1 = !IsNaN(close[b+1]) and IsNaN(close [4] );

AddChartBubble(limit1, static[b+1], "PrevDayHigh", Color.RED);

def NA = Double.NaN;

input agg = AggregationPeriod.DAY;

input showBubbles = yes;
input showValuesInBubbles = yes;
input spaceBetween = 1;

plot prevDayClose;

def exp = IsNaN(close[spaceBetween]);

prevDayClose = if exp then close("period"=agg)[1] else NA;

AddChartBubble(showBubbles, if IsNaN(prevDayClose[1]) and !IsNaN(prevDayClose) then prevDayClose else NA, if showValuesInBubbles then "PrevDayClose $"+prevDayClose else "PrevDayClose", Color.YELLOW, yes);
prevDayClose.SetPaintingStrategy(PaintingStrategy.DASHES);

input spacerText = "-----";
defineGlobalColor("Spacer Color", color.black);
AddLabel(yes, spacerText, GlobalColor("Spacer Color"));


def yesterday_low = low(period = aggregationPeriod)[1];

plot static2 = yesterday_low;
static2.AssignValueColor(color.White);

def limit2 = !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());


static2.AssignValueColor(color.White);
static2.SetPaintingStrategy(PaintingStrategy.DASHES);


def b1 = bubblemover;
def limit12= !IsNaN(close[b+1]) and IsNaN(close );

AddChartBubble(limit2, static2[b+1], "PrevDayLow", Color.Green);
 
Last edited by a moderator:
This is not exactly what you're asking for but it gives dashed lines for the previous days high and or low. It is labeled Green if low and labeled Red if High and you can easily see if your candles cross the line?
Code:
##AsGood_PreviousDayHighLowClose
#Thanks to Welkin forceIndex Offset Close.

input aggregationPeriod = AggregationPeriod.DAY;
def yesterday_high = high(period = aggregationPeriod)[1];

plot static = yesterday_high;
static.AssignValueColor(color.White);
static.SetPaintingStrategy(PaintingStrategy.DASHES);

def limit = !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());

plot static1 = Yesterday_High;
static1.AssignValueColor(color.White);

input bubblemover = 4;
def b = bubblemover;
def limit1 = !IsNaN(close[b+1]) and IsNaN(close [4] );

AddChartBubble(limit1, static[b+1], "PrevDayHigh", Color.RED);

def NA = Double.NaN;

input agg = AggregationPeriod.DAY;

input showBubbles = yes;
input showValuesInBubbles = yes;
input spaceBetween = 1;

plot prevDayClose;

def exp = IsNaN(close[spaceBetween]);

prevDayClose = if exp then close("period"=agg)[1] else NA;

AddChartBubble(showBubbles, if IsNaN(prevDayClose[1]) and !IsNaN(prevDayClose) then prevDayClose else NA, if showValuesInBubbles then "PrevDayClose $"+prevDayClose else "PrevDayClose", Color.YELLOW, yes);
prevDayClose.SetPaintingStrategy(PaintingStrategy.DASHES);

input spacerText = "-----";
defineGlobalColor("Spacer Color", color.black);
AddLabel(yes, spacerText, GlobalColor("Spacer Color"));


def yesterday_low = low(period = aggregationPeriod)[1];

plot static2 = yesterday_low;
static2.AssignValueColor(color.White);

def limit2 = !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());


static2.AssignValueColor(color.White);
static2.SetPaintingStrategy(PaintingStrategy.DASHES);


def b1 = bubblemover;
def limit12= !IsNaN(close[b+1]) and IsNaN(close );

AddChartBubble(limit2, static2[b+1], "PrevDayLow", Color.Green);
Thank you csricksdds. Is there any way can we have an order based off of Inside Bar daily high ?
 
plot Signal =
if Open < High[1] and High > High[1]
then High[1] else Double.NaN;
Signal.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
Thank you Joshua (y) . I see that its plotting on chart .

if we want to have a order based off this study to buy , do we need any tweaks to your solution ?

if today's price at 11 AM cross above yesterday high , we want the buy order to be executed.

I am Not sure whether these study based orders are even reliable and anybody using successfully. Just trying to set it up. Feel free to share any thoughts around that aspect as well
 
Then it would be...

Method > Study > Edit

Open < High[1] and High > High[1]

Trigger if: True

Daily

But there is a lot more to consider, including the order type linked to the condition, whether that order is triggering a bracket or a stop loss order, and so on.
 
  • Like
Reactions: Sai

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
147 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