最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

overlay - Overlaying a candle with a line in Pine Script - Stack Overflow

programmeradmin1浏览0评论

I could need some help with Pine Script. I am trying to overlay a candle with a little bar. Use Case: In a Heikin Ashi Chart, the bar should visualize the close from the last day and they open of the current day, based on the normal bar chart. I am able to plot the line, but the Heikin Ashi bars always overlay them. Driving me crazy. Is there a function to put my line in the from of them?

enter image description here

That is my code so far. I have tried it with a cross instead of a line but this is just a matter of taste so far.

//@version=5
indicator("Real OHLC with Open Line on Heikin Ashi", overlay=true)

t = ticker.new(syminfo.prefix, syminfo.ticker)

real_open = request.security(t, timeframe.period, open)
real_high = request.security(t, timeframe.period, high)
real_low = request.security(t, timeframe.period, low)
real_close = request.security(t, timeframe.period, close)

label.new(
x=bar_index, 
y=real_high, 
text="O: " + str.tostring(real_open) + "\nH: " + str.tostring(real_high) + "\nL: " + str.tostring(real_low) + "\nC: " + str.tostring(real_close), 
color=color.blue, 
textcolor=color.white, 
style=label.style_label_down, 
yloc=yloc.abovebar
>      )

plot(real_open, style=plot.style_cross, color=color.white, linewidth=2, title="Open Line")

I could need some help with Pine Script. I am trying to overlay a candle with a little bar. Use Case: In a Heikin Ashi Chart, the bar should visualize the close from the last day and they open of the current day, based on the normal bar chart. I am able to plot the line, but the Heikin Ashi bars always overlay them. Driving me crazy. Is there a function to put my line in the from of them?

enter image description here

That is my code so far. I have tried it with a cross instead of a line but this is just a matter of taste so far.

//@version=5
indicator("Real OHLC with Open Line on Heikin Ashi", overlay=true)

t = ticker.new(syminfo.prefix, syminfo.ticker)

real_open = request.security(t, timeframe.period, open)
real_high = request.security(t, timeframe.period, high)
real_low = request.security(t, timeframe.period, low)
real_close = request.security(t, timeframe.period, close)

label.new(
x=bar_index, 
y=real_high, 
text="O: " + str.tostring(real_open) + "\nH: " + str.tostring(real_high) + "\nL: " + str.tostring(real_low) + "\nC: " + str.tostring(real_close), 
color=color.blue, 
textcolor=color.white, 
style=label.style_label_down, 
yloc=yloc.abovebar
>      )

plot(real_open, style=plot.style_cross, color=color.white, linewidth=2, title="Open Line")
Share Improve this question asked Mar 31 at 7:53 Trader PfaffiTrader Pfaffi 1 New contributor Trader Pfaffi is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1
  • the image is confusing. could you give another example? – Gu5tavo71 Commented Apr 1 at 0:06
Add a comment  | 

1 Answer 1

Reset to default 0

its a simple matter of changing the settings. on the indicator, select the indicator, right click on the lines / press the settings cog button, navigate to visual order, and click bring to front, hope this helps

发布评论

评论列表(0)

  1. 暂无评论