Candle price move

JohnM

New member
I've been using a script to display the range of the candle body. I was trying ( with no success) to make input to display "Green Candles", "Red Candles", or "Both".

Also I want an input to include/exclude wicks.

Ruby:
# Candle Price Move
plot Number = close - open;
input AveragePriceMove = 0;
Number.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
Number.AssignValueColor(if (close - open) > 0 then CreateColor(13, 183, 135) else CreateColor(220, 31, 78));

Any ideas?
Thanks.

I'm working on this script but having trouble figuring somethings out. This script displays a bubble with candle body ranges. There is an input to select how many bars back to display.

input showbubble = yes;
input bubblemoversideways = 0;
input bubblemoverupdown = .01;

def b = bubblemoversideways;
def b1 = b + 1;
def CandleRange = Round(high[0] - low[0]);

AddChartBubble(IsNaN(close[-10]) and !IsNaN(close), high+bubblemoverupdown, CandleRange, if close > open then Color.LIGHT_GREEN else Color.LIGHT_RED);

I want to only show bubbles with certain candle body range.
Maybe a few input fields (to turn on/off) to input ranges?

Input 1 = Show/color Bubbles only if the body range is between .05 and .08.
Input 2 = Show/color Bubbles only if the body range is between .12 and .20.

...or maybe just if >.05, and another >.15, etc?

Any ideas?

Thanks.

Hi all. I was trying to make it so that this only displays if the candle body equal a specific number. Displaying all values is clutter.

I tried this as i have done with bubles but it doesn't work.

plot Data = if (BodyHeight()) == .05 then 1 else 0;

Any ideas?
Thanks

I've been wanting to paint bars, but i can't seem to get it too work, same with turning off or hiding a feature such as label or bubble.

When adding...
input paintbar = yes;
or...
input showbubble = yes;
I don't get how it works if there is no direct reference to what it's supposed to control.

Can you advice please? Thanks.
 
Last edited by a moderator:
I've been using a script to display the range of the candle body. I was trying ( with no success) to make input to display "Green Candles", "Red Candles", or "Both".

Also I want an input to include/exclude wicks.

Ruby:
# Candle Price Move
plot Number = close - open;
input AveragePriceMove = 0;
Number.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
Number.AssignValueColor(if (close - open) > 0 then CreateColor(13, 183, 135) else CreateColor(220, 31, 78));

Any ideas?
Thanks.

I'm working on this script but having trouble figuring somethings out. This script displays a bubble with candle body ranges. There is an input to select how many bars back to display.



I want to only show bubbles with certain candle body range.
Maybe a few input fields (to turn on/off) to input ranges?

Input 1 = Show/color Bubbles only if the body range is between .05 and .08.
Input 2 = Show/color Bubbles only if the body range is between .12 and .20.

...or maybe just if >.05, and another >.15, etc?

Any ideas?

Thanks.

Hi all. I was trying to make it so that this only displays if the candle body equal a specific number. Displaying all values is clutter.

I tried this as i have done with bubles but it doesn't work.



Any ideas?
Thanks

I've been wanting to paint bars, but i can't seem to get it too work, same with turning off or hiding a feature such as label or bubble.

When adding...

or...

I don't get how it works if there is no direct reference to what it's supposed to control.

Can you advice please? Thanks.

Edit: Fixed Red option 07/16 changed to:
candle_display==candle_display.red and (close - open) < 0


This should do what you are trying to accomplish

Candle_Display
1. You can choose to display both colors of candles or just the green or red
2. If you choose Green or Red, then to hide the candles not selected, those are colored the same color as the chart background. In the image, it is color.black in the assignpriceccolor() code.
3. If you choose input pricecolor == no then just normal price coloring (color.current) will be used.

Bubbles
1. Only bubbles meeting the showbubbles == yes and body_height_range will be displayed
2. The body_height_range is controlled by the max/min inputs. If you want a particular range, then set the min/max to the same amount
3. If you choose showbubbles == no, then no bubbles will display
4.There are 2 addchartbubbles, one for color.light_grren and one for color._light_red
4a. If the Candle_Display is Both or Green then the color.light_green
4b. If the Candle_Display is Both or Red then the color.light_red


Image
The image shows the colors and bubbles displayed
1. The top is Candle_Display == Both
2. The middle is Candle_Display == Green
3. The bottom is Candle_Display == Red

Screenshot 2024-07-15 091910.png
Code:
# Candle Price Move
input candle_display = {default Both, Green, Red};
input pricecolor = yes;
assignPriceColor(
if !pricecolor or candle_display==candle_display.both then color.current
else if candle_display==candle_display.green and (close - open) >= 0 then CreateColor(13, 183, 135)
else if  candle_display==candle_display.red and (close - open) < 0  then CreateColor(220, 31, 78)
else color.black);


#Bubbles
input bodyheight_max = .08;
input bodyheight_min = .03;
def body_height_range = between(bodyHeight(), bodyheight_min, bodyheight_max);

input showbubble = yes;
input bubblemoverupdown = .01;

addchartBubble(
showbubble and (candle_display==candle_display.both or candle_display==candle_display.green) and close>=open and body_height_range,
high+bubblemoverupdown,
astext(bodyheight()),
color.liGHT_GREEN);
addchartBubble(
showbubble and (candle_display==candle_display.both or candle_display==candle_display.red) and close<open and body_height_range,
high+bubblemoverupdown,
astext(bodyheight()),
color.liGHT_red);

#
 
Last edited:

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
561 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