如何将 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 (将#修改为@)