Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
628 views
in Technique[技术] by (71.8m points)

Pine Script "Cannot call falling with arguments (series[float])

Very simple strategy consisting of 3 lines, upper, lower, basis. Basis is trigger for entry. The instant basis changes from rising to falling or falling to rising a position in that direction is entered and the previous position is closed. basis= avg(upper,lower) Trying to code longcondition = falling(basis) but get error message "cannot call falling with arguments (series[float]). Have also tried longcondition = falling(avg(upper,lower)) and same result. New to strategies versus indicator coding but it seems to me its asking me to specify what rising and or falling means. How would I do that? There is no zero line or line crossing. Nothing to compare the basis to other than itself to get context. Just simply it was rising and now it is falling so take the opposite position. How might I accomplish this. Also if it is relevent, and most likely because my longCondition is not properly coded, my if (longCondition) code before my strategy.entry also causes error message undeclared identifyier. Appreciate it thanks for your time.

question from:https://stackoverflow.com/questions/65893093/pine-script-cannot-call-falling-with-arguments-seriesfloat

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Please post your code in a code block next time for clarity.

Falling requires a second argument for number of bars to use when checking whether it's falling. falling(source, length) → series[bool]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...