How to assign hierarchy in painting Candles?

Trigun1127

Member
Hey guys Im trying to get into coding by just looking at other peoples code. I'm trying to paint 4 types of bars but I would like them arranged in a hierarchy. Where if the Top code is first in that hierarchy it will ignore the other paint codes. How would I do this?
 
Solution
I'm looking at the post on page 10 but I don't understand how to use > < when its not something like rsi(14). I don't know anything about coding just taking a shot in the dark here barely know what anything means just guessing. Id assume there would be some kind of function where Gap1up > NormalGapup then Color.XXXX but I don't know how to assign that its in fact greater.

See if this is what you requested

Ruby:
def Gap1Up = open [0] > close[1];
def Gap1Dn = open [0] < close[1];
def NormalGapDown = open < close [3];
def NormalGapUp = open > close [3];
input pricecolor = yes;
AssignPriceColor(
if !pricecolor
then Color.CURRENT
else if Gap1Up and close > open
then Color.ORANGE
else if NormalGapUp and close > open
then...
Tried to delete that line but it didnt change to blue. The problem seems to lie with Bull Bar X Bull bar combinations. I think i added the grey code because i was getting issues with candles that overlapped.
Here it should turn blue because
Code:
close[2]>open[2] and close>open and close<open[2]
adding that doesn't seem to change anything. I think thats right? Im comparing the [2] bull bars open to current bull bars close. if current bull bars close is less then the [2] open there is a gap.
 

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

I think i fixed everything but how do i account for dojis?
Basically def BullandDojiUp= close[2]>open[2] and Doji >close [2]
def BearandDojiUp = close[2]< open[2] and Doji>open[2]
def BullAndDojiDown = close[2]<open[2] and Doji<open[2]
def BearAndDojiDown= close[2]<open[2] and Doji<close[2]
Def DojiUpdoji = Doji[2]>Doji
Def DojiDown = Doji[2]<Doji
 
I think i fixed everything but how do i account for dojis?
Basically def BullandDojiUp= close[2]>open[2] and Doji >close [2]
def BearandDojiUp = close[2]< open[2] and Doji>open[2]
def BullAndDojiDown = close[2]<open[2] and Doji<open[2]
def BearAndDojiDown= close[2]<open[2] and Doji<close[2]
Def DojiUpdoji = Doji[2]>Doji
Def DojiDown = Doji[2]<Doji
Probably include a !Doji types associated with or affecting the one's you already have done and then try putting these at the bottom of those hierarchys.
 
Sorry not sure I understand what you mean. Not sure what !Doji is

Example of a BullandDojiUUp where you do not ( ! = not ) it considered a normalgapup as part of a normalgapup. You would need to exclude all dojis that might be a part of the hierarchies already existing. Then put your section of dojis below those.

Code:
#NormalGap Up Section hierarchy
else if normalgapup and close<=close[2] and !BullandDojiUp
then color.gRAY
else if normalgapup and open<close[2]
then color.gray
else if normalgapup
then color.white
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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