Ask Your Question
1

What is the solution to the syntax error problem with the input "=" in Pine script code?

asked 2021-05-19 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-02-11 10:00:00 +0000

djk gravatar image

The solution to the syntax error problem with the input "=" in Pine script code is to use the assignment operator ":=" instead of "=" in the input statement. This is because the "=" operator is used for comparisons, while ":=" is used for assignment in Pine script. So, the correct code would be:

//@version=4
study("My Script")

myInput = input(10, title="My Input")

This will assign the default value of 10 to the myInput variable and allow the user to modify it from the input dialog.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-05-19 11:00:00 +0000

Seen: 1 times

Last updated: Feb 11 '22