High, Low, Open Arrows?

newwax

New member
Hello Friends,

im trying to create an indicator that puts a dot or arrow above bars where HIGH or LOW = OPEN. im gettin stuck when it comes to plot. anybody out there able to assist.

any/all help much appreciated. code below.


input period= aggregationPeriod.day;
input showarrows = yes;


def open= open (period = aggregationPeriod.DAY);

def high = open(period = aggregationPeriod.DAY);
def low = open(period = aggregationPeriod.DAY);


plot arrows = high == open (period = aggregationPeriod.DAY);
 
Solution
Hello Friends,

im trying to create an indicator that puts a dot or arrow above bars where HIGH or LOW = OPEN. im gettin stuck when it comes to plot. anybody out there able to assist.

any/all help much appreciated. code below.


input period= aggregationPeriod.day;
input showarrows = yes;


def open= open (period = aggregationPeriod.DAY);

def high = open(period = aggregationPeriod.DAY);
def low = open(period = aggregationPeriod.DAY);


plot arrows = high == open (period = aggregationPeriod.DAY);

you didn't clearly state what you are trying to do.
do you want to compare the days open? or every bar open?

you are trying to create a variable called open, a name that is used by the system. same with high and low. that is bad...
Hello Friends,

im trying to create an indicator that puts a dot or arrow above bars where HIGH or LOW = OPEN. im gettin stuck when it comes to plot. anybody out there able to assist.

any/all help much appreciated. code below.


input period= aggregationPeriod.day;
input showarrows = yes;


def open= open (period = aggregationPeriod.DAY);

def high = open(period = aggregationPeriod.DAY);
def low = open(period = aggregationPeriod.DAY);


plot arrows = high == open (period = aggregationPeriod.DAY);

you didn't clearly state what you are trying to do.
do you want to compare the days open? or every bar open?

you are trying to create a variable called open, a name that is used by the system. same with high and low. that is bad practice and leads to wrong data. create unique variable names.

your plot value is true or false, 1 or 0. so it plots a line at 0 or 1.
need to add plot parameter statements to tell it what you want to plot.


this compares the open on each bar, to the high and low on each bar. if a match then it plotys a dot

Code:
#hilo_match_open

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

#input period = aggregationPeriod.day;
#input showarrows = yes;
#def openday = open(period = aggregationPeriod.DAY);

plot zhi = if high == open then high*1.001 else na;
zhi.SetPaintingStrategy(PaintingStrategy.POINTS);
zhi.SetDefaultColor(Color.cyan);
zhi.setlineweight(5);
zhi.hidebubble();

plot zlo = if low == open then low*0.999 else na;
zlo.SetPaintingStrategy(PaintingStrategy.POINTS);
zlo.SetDefaultColor(Color.yellow);
zlo.setlineweight(5);
zlo.hidebubble();
#
 

Attachments

  • img1.JPG
    img1.JPG
    64.6 KB · Views: 23
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
313 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