AssassinAR15
Member
I am looking for a chart bubble that would be placed above the current candle that shows the current stock price. If possible, could someone assist?
this is the syntax that I tried:Hi MerryD, thanks for the response. Just got to try your suggestion but it didn't works. All the previous bubbles are still on the chart. I'm looking for a way to only show the last bubble ONLY to make the chart less busy. In another word, I like to remove all the old bubbles and repaint on the the latest bubble.
You are misplacing a parentheses. I presume your code has sell definedthis is the syntax that I tried:
addchartBubble(isnan(close[-1] and sell), text = close, "price location" = HIGH, color = Color.ORANGE);
addchartBubble(isnan(close[-1]) and sell, text = close, "price location" = HIGH, color = Color.ORANGE);
As I mentioned, I do not know what your definition of 'sell' is. So remove it from your code and you will see the bubble move as price moves frim candle to candle.Thanks Ruby. It's kinda work. Only the last bubble is displayed however currently it get remove on the next bar. Ideally, I like to see the last bubble to keep on displaying and get remove and replace by the latest bubble.
Is there a way to make the text display 2 different numbers, such as the close+1 and the close-1, at the same time? I'm trying to get the bubble to show a range of prices but I can't get the text function to output more than one thing.@ProfessorAR15
Ruby:addchartBubble(isnan(close[-1]), text = close, "price location" = HIGH, color = Color.ORANGE);
Is there a way to make the text display 2 different numbers, such as the close+1 and the close-1, at the same time? I'm trying to get the bubble to show a range of prices but I can't get the text function to output more than one thing.
edit: I'm able to do it using \n but it splits into 2 lines, so I'm wondering if it's possible to do it all in one line.
addchartBubble(isnan(close[-1]), high, (close+1) + " " + (close-1), Color.ORANGE);
Thank you, that works. I thought I tried something like that but I must have had the wrong format or something. I was able to add some brackets to the side and it's displaying perfectly. Thanks again!Try this
Code:addchartBubble(isnan(close[-1]), high, (close+1) + " " + (close-1), Color.ORANGE);
Just tried the fist bubble example, got $6 difference in price for TELSA 5 min chart, $918 vs $912.
Also, make sure you are getting a 'realtime' feed. Here is a copy of the chart from the upper left corner showing my data feed.Just tried the fist bubble example, got $6 difference in price for TELSA 5 min chart, $918 vs $912.
Can the script be changed to show the current price of a different instrument on the same chart?@ProfessorAR15
Ruby:addchartBubble(isnan(close[-1]), text = close, "price location" = HIGH, color = Color.ORANGE);
[Edit code to make additional symbols other than current as inputs rather than def codes.]Can the script be changed to show the current price of a different instrument on the same chart?
Example, If your looking at SPY but want the bubble to show the last price of a specific option or maybe the /ES
![]()
Code:input symbol1 = "/ES"; input symbol2 = "/YM"; input bubble = yes; input bubblemover = 2; def b = bubblemover; def b1 = b + 1; AddChartBubble(bubble and IsNaN(close[b]) and !IsNaN(close[b1]), high[b1], GetSymbol() + ": " + close[b1] + "\n" + symbol1 + " : " + close(symbol1)[b1] + "\n" + symbol2 + " : " + close(symbol2)[b1], Color.ORANGE); #
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
G | Previous day's high that is higher than current price? | Questions | 1 | |
K | current price / price 5 days ago (column) | Questions | 1 | |
S | Price Levels based on Time for Previous Day+ Current Day (EST) | Questions | 1 | |
P | Current price vs PM high Watchlist | Questions | 1 | |
P | current price vs prior day close | Questions | 3 |
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.