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.
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]
falling(source, length) → series[bool]
2.1m questions
2.1m answers
60 comments
57.0k users