Candle price by cent

JDS

New member
Plus
Hello, is there a indicator that shows you how much the price or how many cents the has moved? Like that can be placed at the top or bottom of the candle?
 
This should be close. I took your text to mean you wanted the number of cents movement rather than the number of dollars movement. You can adjust the pricedelta line to change that behaviour as you want. You can also change the painting strategy to be VALUES_BELOW if that suits better. And the colors are fairly easy to understand for modification I hope.

You can also get the range of the candle by changing the close - close[1] part of the line to close - open .

Code:
declare upper;

def pricedelta = round(close - close[1], 3) * 100;

plot centsup = if pricedelta >= 0 then pricedelta else double.nan;
plot centsdn = if pricedelta < 0 then pricedelta else double.nan;

centsup.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsup.setDefaultColor(color.dark_green);

centsdn.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsdn.setDefaultColor(color.dark_red)
 

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

This should be close. I took your text to mean you wanted the number of cents movement rather than the number of dollars movement. You can adjust the pricedelta line to change that behaviour as you want. You can also change the painting strategy to be VALUES_BELOW if that suits better. And the colors are fairly easy to understand for modification I hope.

You can also get the range of the candle by changing the close - close[1] part of the line to close - open .

Code:
declare upper;

def pricedelta = round(close - close[1], 3) * 100;

plot centsup = if pricedelta >= 0 then pricedelta else double.nan;
plot centsdn = if pricedelta < 0 then pricedelta else double.nan;

centsup.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsup.setDefaultColor(color.dark_green);

centsdn.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsdn.setDefaultColor(color.dark_red)
Thank You!
 
This should be close. I took your text to mean you wanted the number of cents movement rather than the number of dollars movement. You can adjust the pricedelta line to change that behaviour as you want. You can also change the painting strategy to be VALUES_BELOW if that suits better. And the colors are fairly easy to understand for modification I hope.

You can also get the range of the candle by changing the close - close[1] part of the line to close - open .

Code:
declare upper;

def pricedelta = round(close - close[1], 3) * 100;

plot centsup = if pricedelta >= 0 then pricedelta else double.nan;
plot centsdn = if pricedelta < 0 then pricedelta else double.nan;

centsup.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsup.setDefaultColor(color.dark_green);

centsdn.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsdn.setDefaultColor(color.dark_red)
Hey quick question. Can you get the price on the candle like it is on the side of the chart? I really appreciate it.
 
Last edited by a moderator:
I like the simplicity of this study...Given that I am an old UI guy, I thought a switch statement could be helpful to quickly bounce between the default pricedelta equation and the pricedelta range equation...

202503250029_c_.jpg


Default PriceDelta
202503250024_a_.jpg


PriceDelta Range
202503250026_b_.jpg



Code:
declare upper;

input PriceDeltaSelector = {default "Close - Close[1]", "Close - Open"};

def pricedelta;
switch (PriceDeltaSelector) {
case "Close - Close[1]" :
   pricedelta = round(close - close[1], 3) * 100;
case "Close - Open" :
   pricedelta = round(close - open, 3) * 100;
}
;

plot centsup = if pricedelta >= 0 then pricedelta else double.nan;
plot centsdn = if pricedelta < 0 then pricedelta else double.nan;

centsup.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsup.setDefaultColor(color.green);

centsdn.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsdn.setDefaultColor(color.red);

Hope this helps...

Good Luck and Good Trading :cool:
 
Last edited by a moderator:
I like the simplicity of this study...Given that I am an old UI guy, I thought a switch statement could be helpful to quickly bounce between the default pricedelta equation and the pricedelta range equation...

View attachment 24376

Default PriceDelta
View attachment 24377

PriceDelta Range
View attachment 24378


Code:
declare upper;

input PriceDeltaSelector = {default "Close - Close[1]", "Close - Open"};

def pricedelta;
switch (PriceDeltaSelector) {
case "Close - Close[1]" :
   pricedelta = round(close - close[1], 3) * 100;
case "Close - Open" :
   pricedelta = round(close - open, 3) * 100;
}
;

plot centsup = if pricedelta >= 0 then pricedelta else double.nan;
plot centsdn = if pricedelta < 0 then pricedelta else double.nan;

centsup.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsup.setDefaultColor(color.green);

centsdn.setPaintingStrategy(paintingStrategy.VALUES_ABOVE);
centsdn.setDefaultColor(color.red);

Hope this helps...

Good Luck and Good Trading :cool:
Thank You Sir!!
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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