微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何将 pinescript 从 v2 转换为 v4?

如何解决如何将 pinescript 从 v2 转换为 v4?

我从交易视图中获得了这个脚本,我想在我的策略中使用它,但它在 v2 中。我需要帮助将其更改为 v4。谢谢大家。

study("Kuskus Starlight",overlay=false)
//parameters
range = input (30,title="Range Periods")
pricesmoothing = input(0.3,title = "Price Smoothing")
indexsmoothing = input(0.3,title = "Index Smoothing")

highesthigh = highest(high,range)
lowestlow = lowest(low,range)

greatestrange = (highesthigh - lowestlow)!=0?(highesthigh-lowestlow):greatestrange[1]
midprice = (high+low)/2

//pricelocation
pricelocation = 2*((midprice-lowestlow)/greatestrange)-1

//smoothing of pricelocation
extmapbuffer = pricesmoothing*nz(extmapbuffer [1]) + (1-pricesmoothing)*pricelocation
smoothedlocation = (extmapbuffer>0.99?0.99:(extmapbuffer<-0.99?-0.99:extmapbuffer))!=1?(extmapbuffer>0.99?0.99:(extmapbuffer<-0.99?-0.99: extmapbuffer)): smoothedlocation [1]

//Fisher location
fishindex = log((1+smoothedlocation)/(1-smoothedlocation))

//smoothingoffishindex
extmapbuffer1 = indexsmoothing*nz(extmapbuffer1[1])+(1-indexsmoothing)*(fishindex)
smoothedfish = extmapbuffer1

plot(smoothedfish,color=smoothedfish>0?green:red,linewidth=3,style=histogram)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。