如何绘制以前的OHLC4 HMA Candle Wick High和Low for Stoploss ??? pinescript
我绘制了蜡烛,我只是想用先前的蜡烛wick高和低点绘制我的牛油。较低,长短短。
我可以使用真正的Close和Heikien Ashi来绘制它,但是我想将止动物放在图表上的HMA蜡烛上。
保罗
//@version=5
strategy("Hull Candles", overlay=true, margin_long=100,
margin_short=100)
len = input(10, title= "Hull Length")
lenclose = input(1, title="Hull Close Lenth")
//Candle values
o = ta.hma(open,len)
c = ta.hma(close,len)
h = ta.hma(high,len)
l = ta.hma(low,len)
t = ticker.new(syminfo.prefix, syminfo.ticker)
t2 = ticker.heikinashi(t)
ohlcFour = ta.hma(ohlc4,len)
colorBody = ohlcFour > ohlcFour[1] ? color.white : #6F00FF
plotcandle(o,h,l,c, color=colorBody, title= "Hull Candles")
//Stoploss labels
longstoploss = request.security(ohlc4, timeframe.period, low[1])
shortstoploss = request.security(ohlc4, timeframe.period, high[1])
longstop = str.tostring(longstoploss)
shortstop = str.tostring(shortstoploss)
Longstoplabel = label.new(x=bar_index,y=na, text = longstop, yloc = yloc.belowbar,textcolor=color.white, color=#000000,size = size.normal,style = label.style_none)
Shortstoplabel = label.new(x=bar_index,y=na, text = shortstop, yloc = yloc.abovebar,textcolor= #6F00FF, color=#000000,size = size.normal,style = label.style_none)
label.delete(Longstoplabel[1])
label.delete(Shortstoplabel[1])
I have the candles plotted and I'm just trying to plot my stoploss in ticks with the previous candles wick high and low. Low for Longs and High for Shorts.
I can get it to plot using the real close and heikien ashi but I would like to have the stoploss with the plotted HMA candles that are on the chart.
Any help would be awesome and big time thanks in advance,
Paul
//@version=5
strategy("Hull Candles", overlay=true, margin_long=100,
margin_short=100)
len = input(10, title= "Hull Length")
lenclose = input(1, title="Hull Close Lenth")
//Candle values
o = ta.hma(open,len)
c = ta.hma(close,len)
h = ta.hma(high,len)
l = ta.hma(low,len)
t = ticker.new(syminfo.prefix, syminfo.ticker)
t2 = ticker.heikinashi(t)
ohlcFour = ta.hma(ohlc4,len)
colorBody = ohlcFour > ohlcFour[1] ? color.white : #6F00FF
plotcandle(o,h,l,c, color=colorBody, title= "Hull Candles")
//Stoploss labels
longstoploss = request.security(ohlc4, timeframe.period, low[1])
shortstoploss = request.security(ohlc4, timeframe.period, high[1])
longstop = str.tostring(longstoploss)
shortstop = str.tostring(shortstoploss)
Longstoplabel = label.new(x=bar_index,y=na, text = longstop, yloc = yloc.belowbar,textcolor=color.white, color=#000000,size = size.normal,style = label.style_none)
Shortstoplabel = label.new(x=bar_index,y=na, text = shortstop, yloc = yloc.abovebar,textcolor= #6F00FF, color=#000000,size = size.normal,style = label.style_none)
label.delete(Longstoplabel[1])
label.delete(Shortstoplabel[1])
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定您需要什么,但是如果您想要船体蜡烛低,
因此,如果要将止动物放在上一个船体蜡烛低的地方,那就是
hull_candle_low [1
]
和以前的船体蜡烛高是
hull_candle_high [1]
not sure what you need, but if you want the hull candle low,
so if you want to put the stoploss at the previous hull candle low, that would be
Hull_Candle_low[1]
same thing with shorts/high
and the previous hull candle high is
Hull_Candle_high[1]