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...
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.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)
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);
Thank You Sir!!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![]()
Hello, can the price on the candle be enlarged by anyway?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![]()
Hello, Is it possible to put the actual price of what is currently showing in the market on the candle? Like how the bubble of the price shows to the right of the chart, can it show on the candle?Hey quick question. Can you get the price on the candle like it is on the side of the chart? I really appreciate it.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
J | 5 Min candle Total Price | Questions | 1 | |
C | if close of previous candle > $10 and current price <= $10 | Questions | 3 | |
J | Highest Price Volume Line within a Candle? | Questions | 1 | |
D | Script for 4 hour candle high/low price levels | Questions | 1 | |
J | Candle price move | Questions | 1 |
Start a new thread and receive assistance from our community.
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.
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.