help with only show current candle line from high/low on range chart

how can i draw a line +- 20ticks ($6) from high and low? only on current candle

i use range chart and and wanted a study to draw one line from high- 6 and one low + but only current candle. this way it gives me a idea where the next candle will likley end

thank you

Code:
input Range = 6;

def high_line = low + range;
def low_line = high - range;

plot high_linex = high_line;
high_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
high_linex.SetLineWeight(1);
high_linex.SetDefaultColor(Color.RED);

plot low_linex = low_line;
low_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
low_linex.SetLineWeight(1);
low_linex.SetDefaultColor(Color.RED);
 
Solution
how can i draw a line +- 20ticks ($6) from high and low? only on current candle

i use range chart and and wanted a study to draw one line from high- 6 and one low + but only current candle. this way it gives me a idea where the next candle will likley end

thank you

Code:
input Range = 6;

def high_line = low + range;
def low_line = high - range;

plot high_linex = high_line;
high_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
high_linex.SetLineWeight(1);
high_linex.SetDefaultColor(Color.RED);

plot low_linex = low_line;
low_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
low_linex.SetLineWeight(1);
low_linex.SetDefaultColor(Color.RED);


here is one way
draw a line between 2 bars, but only show the color on...
how can i draw a line +- 20ticks ($6) from high and low? only on current candle

i use range chart and and wanted a study to draw one line from high- 6 and one low + but only current candle. this way it gives me a idea where the next candle will likley end

thank you

Code:
input Range = 6;

def high_line = low + range;
def low_line = high - range;

plot high_linex = high_line;
high_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
high_linex.SetLineWeight(1);
high_linex.SetDefaultColor(Color.RED);

plot low_linex = low_line;
low_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
low_linex.SetLineWeight(1);
low_linex.SetDefaultColor(Color.RED);


here is one way
draw a line between 2 bars, but only show the color on the last bar.

Code:
# single_bar_line_0
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 x = (lastbar or lastbar[-1] );

input Range = 6;
def high_line = low + range;
def low_line = high - range;

plot high_linex = if x then high_line else na;
high_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
high_linex.SetLineWeight(2);
#high_linex.SetDefaultColor(Color.RED);
high_linex.AssignValueColor(if lastbar then color.red else color.black);

plot low_linex = if x then low_line else na;
low_linex.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
low_linex.SetLineWeight(2);
#low_linex.SetDefaultColor(Color.RED);
low_linex.AssignValueColor(if lastbar then color.red else color.black);
#

N3qHS4n.jpg


might be able to do it with addchart()
 
Solution

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
350 Online
Create Post

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