admin管理员组文章数量:1296254
I have a library function which requires a "simple int" input. In creating a new UDT I find that the fields only produce "series int" inputs for this function.
Here is a short example:
//@version=6
indicator("My script")
// Function that requires a "simple int" input:
square( simple int n ) => n*n
// UDT "Test" with one "int" field:
type Test
int Field1
// New "Test" declared as "A" with Field1 = 8:
var A = Test.new( Field1 = 8 )
// Error reports A.Field1 is "series int"!
plot( square( A.Field1 ) )
// ^^^^^^^^
// "series int" when "simple int" is expected
// Question: Where in the above code should "A" or "A.Field1" be declared "simple"?
本文标签: pine scriptWhere to declare a variable quotsimplequot when adding a UDTStack Overflow
版权声明:本文标题:pine script - Where to declare a variable "simple" when adding a UDT? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741617310a2388600.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论