admin管理员组文章数量:1406177
If the for only does one iteration it correctly calculates the value to plot but if I do it two or more times, which is what I need, the variable is calculated incorrectly.
size = array.size(etf_sectoriales)
for m = 0 to size - 1
float fractal_convergence = na
[wave_up_one,wave_down_one,structure_up_one,structure_down_one] = william_fractal(array.get(etf_sectoriales,m),temporality_one,n)
[wave_up_two,wave_down_two,structure_up_two,structure_down_two] = william_fractal(array.get(etf_sectoriales,m),temporality_two,n)
[wave_up_three,wave_down_three,structure_up_three,structure_down_three] = william_fractal(array.get(etf_sectoriales,m),temporality_three,n)
first_value := (wave_up_one ? weight_one : 0 ) + (wave_down_one ? -weight_one : 0) + (structure_up_one ? weight_one : 0) + (structure_down_one ? -weight_one : 0)
second_value := (wave_up_two ? weight_two : 0 ) + (wave_down_two ? -weight_two : 0) + (structure_up_two ? weight_two : 0) + (structure_down_two ? -weight_two : 0)
third_value := (wave_up_three ? weight_three : 0 ) + (wave_down_three ? -weight_three : 0) + (structure_up_three ? weight_three : 0) + (structure_down_three ? -weight_three : 0)
fractal_convergence := first_value + second_value + third_value
array.push(fractal_convergence_array,fractal_convergence)
plot(array.get(fractal_convergence_array,0))
My idea is to have an array with the calculation done for n different tickers and then plot each element of the array
本文标签: pine scriptError with variable calculation in iteration in pinescriptStack Overflow
版权声明:本文标题:pine script - Error with variable calculation in iteration in pinescript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744972877a2635340.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论