admin管理员组文章数量:1180551
I'm struggling to get high volume point zones in pinescript but stuck on releasing array at end. following my script on V5
int lookback = input.int(50, title="Lookback Period", minval=1)
float volumeThreshold = input.float(1.5, title="Volume Threshold (Multiplier of
Average Volume)", minval=1.0)
int zoneWidth = input.int(5, title="Zone Width (in ticks)", minval=1)
// Calculate average volume
avgVolume = ta.sma(volume, lookback)
// Identify significant volume levels
significantVolume = volume > avgVolume * volumeThreshold
// Store high and low of significant volume bars
var float[] zoneHighs = array.new_float()
var float[] zoneLows = array.new_float()
if significantVolume
array.push(zoneHighs, high)
array.push(zoneLows, low)
// Keep only the last 'lookback' zones
if array.size(zoneHighs) > lookback
array.remove(zoneHighs, 0)
array.remove(zoneLows, 0)
// Plot liquidity zones
for i = 0 to array.size(zoneHighs) - 1
zoneTop = str.tostring(array.get(zoneHighs, i))
zoneBottom = str.tostring(array.get(zoneLows, i))
///ERROR getting here with ZONETOP & ZONEBOTTOM
box.new(bar_index - lookback, zoneTop, bar_index, zoneBottom,
border_color=color.new(color.blue, 0), bgcolor=color.new(color.blue, 90),
text="Liquidity Zone")
// Highlight significant volume bars
bgcolor(significantVolume ? color.new(color.orange, 90) : na, title="Significant
Volume")
Any question, feel free to ask, please leave if you don't understand
本文标签:
版权声明:本文标题:pine script - How to get solve an error An argument of 'series string' type was used but a 'series float 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738137174a2065515.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论