Using Lower Chart To Plot Arrows On Upper Chart

TRexing

New member
Using Lower Chart To Plot Arrows On Upper Chart

So I have some code that looks like this:
Code:
declare lower;

plot UpSignal = if c1 + c2 + c3 + c4 + c5 == 5 THEN 1 else Double.Nan;
UpSignal.SetDefaultColor(Color.GREEN);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

The declare lower makes it so the arrows appear in the lower area. How can I plot the arrows on the chart itself like right under the bars for buy signals and above for sell signals?

Second question, is there a way to make it show the buy signal only if the status has changed? Like if the previous values are still a buy don't display another up arrow? So it doesn't display a line of buy arrows.
 
Last edited by a moderator:
Solution
Hi everyone! Hope everyone is doing well.

So I have some code that looks like this:

Code:
declare lower;

plot UpSignal = if c1 + c2 + c3 + c4 + c5 == 5 THEN 1 else Double.Nan;
UpSignal.SetDefaultColor(Color.GREEN);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

The declare lower makes it so the arrows appear in the lower area. How can I plot the arrows on the chart itself like right under the bars for buy signals and above for sell signals?

Second question, is there a way to make it show the buy signal only if the status has changed? Like if the previous values are still a buy don't display another up arrow? So it doesn't display a line of buy arrows.


If you disable the declare lower statement, by...
Hi everyone! Hope everyone is doing well.

So I have some code that looks like this:

Code:
declare lower;

plot UpSignal = if c1 + c2 + c3 + c4 + c5 == 5 THEN 1 else Double.Nan;
UpSignal.SetDefaultColor(Color.GREEN);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

The declare lower makes it so the arrows appear in the lower area. How can I plot the arrows on the chart itself like right under the bars for buy signals and above for sell signals?

Second question, is there a way to make it show the buy signal only if the status has changed? Like if the previous values are still a buy don't display another up arrow? So it doesn't display a line of buy arrows.


If you disable the declare lower statement, by putting a # in front of it, the arrows will appear on the upper chart.

Note: boolean plots may not work as expected in lower charts. they are plotted at the close price levels.

a lower study
Code:
# fivecond_booleanarrows_0
declare lower;
def c1 = close > close[1];
plot UpSignal = if c1 + c1[1] + c1[2] + c1[3] + c1[4] == 5 THEN 1 else Double.Nan;
UpSignal.SetDefaultColor(Color.GREEN);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#


kS5l5gy.jpg



change it so the user can choose to show, all arrows or just the first one in each series.
disable the declare lower, to make it an upper study.

Code:
# fivecond_booleanarrows_0
#declare lower;
def c1 = close > close[1];
input show_just_first_arrow_of_series = yes;
def UpSignal = if c1 + c1[1] + c1[2] + c1[3] + c1[4] == 5 THEN 1 else 0;;
plot z = if !show_just_first_arrow_of_series then upsignal
  else if (!UpSignal[1] and UpSignal) then 1
  else 0;
z.SetDefaultColor(Color.GREEN);
z.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#

settings
XTPWZCj.jpg
 
Last edited:
Solution

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

Hi, thanks for the reply!

I do kind of need the declare lower statement because it's outputting a lot of other stuff too. I was wondering if there's a way to place just the arrows on the main chart?
 
Hi, thanks for the reply!

I do kind of need the declare lower statement because it's outputting a lot of other stuff too. I was wondering if there's a way to place just the arrows on the main chart?
It is not possible for the lower chart study to plot arrows on the upper chart.
@halcyonguy explained how to put a copy of the study in the upper chart to plot the arrows.
You would keep another copy of the original study for use in the lower chart.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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