Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am new to think or swim programming and am trying to create an indicator that colors the average true range bar (with a 1 bar period) red if it is a down bar that is 20% greater than the 14 period atr. Same thing for an Up bar - color it green if it is a 20% greater than the 14 period atr. Basically i am just trying to identify big range bars.
Thank you and I appreciate any help with this.
peace
russ123
Can you help answer these questions from other members on NexusFi?
russ123 , does this meet your needs? My experience is that TOS won't display more than one "color bar" at a time. So I think you have to run two separate studies at the same time, unless somebody knows a workaround to run both in one study. So in the below code, run one as-is and run a copy of it but remove the # from the AssignPriceColor for downbar and move it to the AssignPriceColor for upbar. Interesting, I just finished writing a TS tutorial and covered this or I wouldn't have known about only one colorbar being displayable. Hope this helps.
P.S.- I used "magenta" not red so I could see it on my charts. Just change magenta to red.
The following user says Thank You to tangerine for this post:
Hi
i'm also new to tos script-writing and i want to create a similar script like russ:
i want the background color of the main chart to become (e.g.) green when the macd line is above zero and above the signal line, and red if it goes vice versa. in all other cases the color of the background should stay as default (neutral).
this would be an enormous step up to my strategy.
does someone know how to...?