How do I get a Bubble to appear outside the chart like other Bubbles for studies such as MACD, SMA,etc? I have did some research but can't find any code to relocate the Bubble outside the chart. I created code to show the Close with a Bubble. But the Bubble is inside the chart.
It appears my Question was truncated or changed. It should have been the same as the 1st sentence of my post.
After further research found the following.
If your wondering, I coded this because I use Heikin Ashi candles, and as you know the closing price it shown is not the real closing price.
And I get tired of having to take the time to move my head to see the real closing price at the far left side of the chart. Also, I have a limited coding experience., but I can patch things together, which is how I created this after doing some research and sending hours to create it. You can be sure I will be asking for advice in the future. Hope this can help someone in the future.
Code:
#Daily Close
input aggregationPeriod = AggregationPeriod.DAY;
input showOnlyLastPeriod = yes;
def prevPrice = close(period = aggregationPeriod)[-1];
def price = close(period = aggregationPeriod);
plot DailyClose = if showOnlyLastPeriod and !IsNaN(prevPrice) then Double.NaN else price;
def x = DailyClose;
DailyClose.SetDefaultColor(GetColor(9));
DailyClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
AddChartBubble((x + 8) > DailyClose, close, close, Color.yellow, yes);
It appears my Question was truncated or changed. It should have been the same as the 1st sentence of my post.
After further research found the following.
- The (x +8) > Daily Close, was not necessary, it only needed an x, you cannot use Close for it .
- AddChartBubble((x + 8) > DailyClose, close,: if you add or subtract such as close +5, it will move the vertical position of the bubble.
If your wondering, I coded this because I use Heikin Ashi candles, and as you know the closing price it shown is not the real closing price.
And I get tired of having to take the time to move my head to see the real closing price at the far left side of the chart. Also, I have a limited coding experience., but I can patch things together, which is how I created this after doing some research and sending hours to create it. You can be sure I will be asking for advice in the future. Hope this can help someone in the future.
Last edited by a moderator: