首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编译图形函数TradingView松脚本中的错误

编译图形函数TradingView松脚本中的错误
EN

Stack Overflow用户
提问于 2020-12-30 14:23:17
回答 1查看 267关注 0票数 0

在以plotshape函数保存脚本时,我会得到以下错误消息,无法确定修复程序:

脚本无法翻译自:,text="Buy",location.belowbar,color.green,transp=

脚本是Ubertrend:https://www.tradingview.com/script/J3op4W9q-UberTrend-v1-1/的修改版本

代码语言:javascript
复制
// Plot entries 
plotshape(cross(close,Tsl) and close>Tsl ? True : na,title="SuperTrend Long", shape.triangleup,text="Buy",location.belowbar,color.green,transp=0) // Super Trend Long
plotshape(cross(Tsl,close) and close<Tsl ? True : na,title="SuperTrend Short", shape.triangledown,text="Sell",location.abovebar,color.red,transp=0) // Super Trend Short
plotshape(longToggle ? (k <= kMin and Trend == 1 ? Trend : na) : na, "Long Entry", shape.labelup,location.belowbar,navy,0,0, "", black) // Stochastic Long Entry
plotshape(longAltToggle ? (rising(k,1) and cross(k, 50) and Trend == 1 ? Trend : na) : na, "Long Alt Entry", shape.cross,location.belowbar,olive,0,0, "", black) // Stochastic Long Entry
plotshape(longExitToggle ? (k >= kMax and Trend == 1 ? Trend : na) : na, "Long Exit", shape.xcross,location.abovebar,red,0,0, "", black) // Stochastic Long Exit
plotshape(shortToggle ? (k >= kMax and Trend == -1 ? Trend : na) : na, "Short Entry", shape.labeldown , location.abovebar, navy,0,0, "", black) // Stochastic Short Entry
plotshape(shortAltToggle ? (falling(k,1) and cross(k, 50) and Trend == -1 ? Trend : na) : na, "Short Alt Entry", shape.cross , location.abovebar, olive,0,0, "", black) // Stochastic Short Entry
plotshape(shortExitToggle ? (k <= kMin and Trend == -1 ? Trend : na) : na, "Short Exit", shape.xcross , location.belowbar, red,0,0, "", black) // Stochastic Short Exit
EN

回答 1

Stack Overflow用户

发布于 2020-12-30 19:34:11

这个图形函数看起来像个小马车。只是想出了一个办法让它发挥作用:

代码语言:javascript
复制
// Plot entries
buy_signal = (cross(close,Tsl) and close>Tsl) ? true : na
sell_signal = (cross(Tsl,close) and close<Tsl) ? true : na
plotshape(buy_signal ? true : na,title="SuperTrend Long",text="Buy",style=shape.triangleup,size=size.small,location=location.belowbar,color=#34eb46,transp=10) // Super Trend Long
plotshape(sell_signal ? true : na,title="SuperTrend Short",text="Sell",style=shape.triangledown,size=size.small,location=location.abovebar,color=#eb4334,transp=10)// Super Trend Short
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65508490

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档