Strategy never stops: AdaptiveLaguerre
Author: Carova
Creation Date: 12/28/2015 5:22 PM
profile picture

Carova

#1
I ran across an interesting situation. When I run the following script

CODE:
Please log in to see this code.


for a single equity (e.g. AAPL) in Chart Mode it never stops.

Does anyone else get the same results with this Chartscript?

Vince
profile picture

Eugene

#2
Press Escape key. Now you know that AdaptiveLaguerre doesn't like recursion. :)
profile picture

Carova

#3
Eugene, you don't say! :)

More to the point, this should not happen. There is no reason why any series input to any function should cause this problem. That's what programmers get paid to prevent! ;)

Vince
profile picture

Eugene

#4
Actually, this indicator code (its WL4 version) was submitted by a community member. ;)
profile picture

Carova

#5
Could you take a quick look and see if there is a reason for this problem? I looked at it but I am far from knowledgeable to see the cause of the problem.

Vince
profile picture

Eugene

#6
As a workaround, choose a different period. An equal period causes the issue.
profile picture

Carova

#7
Is it related to a poor caching problem?

Vince
profile picture

Eugene

#8
Caching was the first place I looked at.
profile picture

Eugene

#9
Debugging shows that it's a problem with AdaptiveLaguerre's sorting algorithm being stuck in an endless loop. Sorry, can't help with fixing the logic but you've got the workaround.

btw, no other indicators seem to have a similar problem (being applied to themselves). It's AdaptiveLaguerre specific.
profile picture

Eugene

#10
Here we go again! :)

Adaptive Laguerre Indicator "hangs" in a Rotation Strategy

It only took three years to get to the bottom of the issue but it's about to get fixed! :)
profile picture

Eugene

#11
Bug fixed in Community Indicators v2019.04:

* Fix: AdaptiveLaguerre makes WL freeze if DataSeries has many zero bars
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).