在Pine脚本中,"plotshape"函数用于在图表上绘制形状指示器,以便在特定条件下显示图形。要更改"plotshape"的位置,可以使用该函数的参数来指定所需的位置。 "plotshape"函数的语法如下: 代码语言:txt 复制 plotshape(series, title, location, color, style, text, textcolor, siz
要突出显示接近移动平均值的candle,可以使用plotshape()函数来在图表上绘制形状。plotshape()函数接受多个参数,包括形状类型、位置、颜色等。 在pine脚本中,可以使用条件语句来判断当前价格是否接近移动平均值。例如,可以计算当前价格与移动平均值之间的差异,并设置一个阈值来确定是否接近。
plotshape(series=goldcross, title="BUY!", text="BUY", location=location.belowbar, color=color.rgb(1, 100, 50), size=size.small, textcolor=color.white, style=shape.labelup) ma21=ta.sma(close,21)这句代码可能会有人问,简单解释一下: 这句表示我们自定义了一个变量,叫做ma21。ma21里面直接...
plot(ema) bull_ec = close[1] < open[1] and open <= close[1] and close >= open[1] and swingLow and close > ema bear_ec = close[1] > open[1] and open >= close[1] and close <= open[1] and swingHigh and close < ema plotshape( bull_ec, style=shape.triangleup, location...
我尝试使用 if 条件,但在条件下不允许使用 Plotshape。 plotshape(buy, title='BUY ', text='▲', style=shape.labelup, location=location.belowbar, color=color.new(#000c76, 0), textcolor=color.new(#ffffff, 0), size=size.tiny) plotshape(sell, title='SELL', text='▼', style=shape....
在实践中,尝试删除您定义的与颜色和透明度设置相关的所有输入,例如 switchColor 和 transpSwitch,而是对值进行硬编码,然后 PineScript 应该在 Style 而不是 Input 中显示该选项。0投票 我有类似的问题并解决了;当我将条件颜色分配给“plotColor”变量并更改绘图函数的透明度时,就会发生这种情况,如下面的代码所示:plo...
//@version=5indicator("My Script",overlay=true)src=close a=ta.sma(src,5)b=ta.sma(src,50)c=ta.cross(a,b)plot(a,color=color.blue)plot(b,color=color.black)plotshape(c,color=color.red) 或者是这样写的: //@version=5strategy("My Strategy",overlay=true)longCondition=ta.crossover(ta....
You may also need to play around withbgcolor()or withplotshape()in order to see the signals better – but that’s all there is to it! If you have any questions or suggestions about what you’d like me to cover next, feel free to leave them below. See you next time!
//@version=5indicator("My Script",overlay=true)src=close a=ta.sma(src,5)b=ta.sma(src,50)c=ta.cross(a,b)plot(a,color=color.blue)plot(b,color=color.black)plotshape(c,color=color.red) 或者是这样写的: //@version=5strategy("My Strategy",overlay=true)longCondition=ta.crossover(ta....
plot(a, title="a") 时间序列 时间序列并不是一种数据类型或者格式,时间序列是PINE语言中一种基本结构的概念。用来储存时间上连续变动的值,每个值都对应一个时间点。时间序列这种概念的结构很适合应用于处理、记录随时间变化的一系列数据。 以内置变量open为例,open内置变量记录了每一根K线BAR的开盘价,如果这个open...