0

I am struggling! I am brand new to Pine Script. So, I apologize for missing anything.

I'm trying to declare a function (user defined) in order to call later in request.security without a mutable variable error. No matter what I try, I keep getting "syntax error at input '>='".

This is what I have the error on. I've checked the user manual, and I cannot figure it out.

frup_func() >=
    up = high[HighWickInput]>=high[HighWickInput]+1 and high[HighWickInput]>=high[HighWickInput]+2 and high[HighWickInput]>=high[HighWickInput]-1 and high[HighWickInput]>=high[HighWickInput]-2
    frup = 0
    frup := up ? HighWickInput : frup[1]

I tried including the HighWickInput variable in the function as well--so that all things that this function could POSSIBLY touch were there, but that didn't work either. I also don't think that the up variable needs to be in there, but I don't know.

I'm trying to achieve something like this.

What have I missed or messed up?

Thanks for any guidance!

1 Answer 1

0

User functions are declared with the => operator, not >= :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.