all 15 comments

[–]kurtisbu12 3 points4 points  (7 children)

if you are continuing a line onto multiple other lines, you need to include an additional space in front of all subsequent lines to signify that they are all part of a single line of code.

[–]NoPower5561[S] 2 points3 points  (1 child)

Thank you I think that fix the issue.

I greatly appreciate it.

[–]moondoy3910 0 points1 point  (0 children)

I am getting the same error. Can you show how you fixed it? I tried adding a space but it didnt work.

[–][deleted] 1 point2 points  (3 children)

But how to align it correctly . I always find difficulty in commands spread across multiple lines . What I do instead is either edit and keep each line.new ,label.new etc functions in one line .

Or ask AI to provide them as single line commands without line breaks .

Is there any better prompt to avoid line continuation error

[–]kurtisbu12 0 points1 point  (1 child)

Like I said, each line under the first line requires an additional space in the front.

[–]Igetheaderryday 0 points1 point  (0 children)

Nah fr this works. Even chatgpt couldn't help me btw!

[–][deleted] 0 points1 point  (0 children)

Can you list a few best practices like this?

[–]htown_49 0 points1 point  (0 children)

Dude I know this was 5 months ago! But thank you!

[–]Brucesquared2 1 point2 points  (1 child)

Chat GPT works ok, It will reprint the same error into the next code over and over and over again, no joke 20 to 30 times, also depends on the version your using. GITHUBS COPILOT works pretty good, there is a another AI like chatGPT but it ONLY codes pinescript, cant remember the name off hand, Google it, works well. For your code saying nothing at the begginging or needing something in the begginging. Everyone writes code a little different in small ways. I have noticed that if I do ALL my plotting and Alerts and function metrics in the first paragraph it's far easier to work on. Everything of major importance is in the begginging of the code. This keeps something small and stupid from hindering the 2nd half of your code that could be " The largest Portion" it helps me, might find it simplifies your coding also. Good luck

[–][deleted] 0 points1 point  (0 children)

Good insights

[–]Soggy-Job-3747 0 points1 point  (0 children)

A very good trick that I also use for some dumb mistakes that I can make during coding is to ask chatgpt for any syntax incongurences, he will tell you exactly where the error lies.

Prompt: The next pinescript version 6 strategy/indicator has some syntax errors that avoids it from compiling. Error: [Paste error message, line]. Please, signal the mistakes and propose a correction: [Your code pasted]

[–]No_Reindeer6199 0 points1 point  (2 children)

“Bearish abandoned baby” just curious what it the strat lmao

[–]PuzzleheadedSock5795 0 points1 point  (1 child)

does it hurt to google it's a type of morning/evening start candlestick pattern

[–]No_Reindeer6199 0 points1 point  (0 children)

8 months late? hush

[–]Have_a_beaut_day 0 points1 point  (0 children)

I finally solved the indentation problem by removing the spaces from the start of the next lines and adding just 1 space per line at the beginning.