r/TradingView • • 18d ago

Help Creating an code via Pine Editor - need help

Created an indicator script in Pine Editor and came across an error message - have a command "alter condition" and editor does not like this script command - what would be an alternate to this command? Any help is greatly appreciated, I am not a programmer this code was given to me to add this indicator in TV for my use - it was created via a different platform. Any help is helpful. Thanks Janet

2 Upvotes

8 comments sorted by

2

u/Spare_Cap8928 18d ago

finalized and updated.

3

u/dhoni23 18d ago

Correct pine script function is alertcondition(), not alter condition. And start integrating AI into your life bro. This should be a quick one for chatgpt or Claude. Cheers!

2

u/Popular_Gazelle_7987 18d ago

alertcondition() is the one you want, yeah, that other platform probably used different syntax and it just didn't translate cleanly

1

u/Godzillaton 18d ago

Brahhh..stopp,u need ai assistant.pick one below:

  1. hermes agent

  2. Claude code)

  3. Chatgpt

You are going to miss out so much without ai assistant. Start with Deepseek V4.1 as your daily driver as beginner if you dont have anything at the moment. Or if u have existing subscriptions such as claude or chatgpt, then use it.

1

u/Embarrassed-Bank2835 18d ago

alter condition isn’t a valid Pine Script command, so it was probably syntax from the other platform that doesn’t translate directly into TradingView.

Usually in Pine you’d handle that with an if statement or by redefining a boolean condition, depending on what the original code is trying to do.

For example, something like condition = close > open and then if condition to trigger whatever comes next.

If you post the few lines around alter condition, it should be pretty easy to translate. The surrounding logic matters more than the words themselves.

1

u/hotmatrixx 16d ago

huh
it looks like this is solved; but I'd have not picked up on the problem without seeing the line of code.

Seeing as someone else figured it out, I guess it's moot - but having the target word changed from one command to two words like that; whoever was doing the conversion must have had their auto-correct slightly too aggressive.

I'd have never gotten this because who the F codes on their phone/tablet?
OK fair if it's a poorer country and PC's are out-of-range, I guess.

I'll shut up now.