gr68
gr68

Reputation: 502

Failed to convert a pine 3 script to version 4

I have this pine3 Trading view script which I converted to pine 4 using the TV converter .

https://codeshare.io/5ZYxpV

however when I execute it after the conversion, I receive this error

line 110: Variable 'results' was declared with 'series[integer]' type. Cannot assign it expression of type 'series[float]'.

how to fix this ?

Upvotes: 0

Views: 105

Answers (1)

PineCoders-LucF
PineCoders-LucF

Reputation: 8789

For line 104, use this to declare the "float" explicitly:

    float results = 0 + bar_index  //tv series spoofing

You can then safely ignore the compiler warning on line 78: enter image description here

Upvotes: 1

Related Questions