Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 16:53:48 +0000



Post From: Adaptive Laguerre Moving Avg

[2016-10-25 16:36:02]
User80860 - Posts: 5
Hello everyone, great forum here.
Sierra Chart is a blazing fast platform which I'm really enjoying to use.

I have the code for the Laguerre Filter, or Moving Average, from TDA Tos. It has a few, but crucial, differences from the ALF we already have available at SC. Namely:
- The ability to choose the input for price (Last (close), high, low, Hl2, etc)
- And MOST IMPORTANTLY the ability to define the GAMMA value. On the code created by Kiwi (which is great BTW) you can't change the pre-defined gamma, and that makes a world of difference.

Would anyone be willing to change these features and create a new Laguerre Code with them, please? A good coder could do this in 5 min.

Laguerre Moving Average, or Filter, is VERY good, fast and reliable. I've been using it for a whilte. That's why I think it's worth the effort of having it (the more flexible one) here on SC.

here's the code I have in TOS' (easy) language. Thanks in advance!

script lag{
input p = hl2;
input gamma = .800;
def L0 = ((1 - gamma) * p) + (gamma * L0[1]);
def L1 = (-gamma * L0) + L0[1] + (gamma * L1[1]);
def L2 = (-gamma * L1) + L1[1] + (gamma * L2[1]);
def L3 = (-gamma * L2) + L2[1] + (gamma * L3[1]);
def Laguerre = (L0 + (2 * L1) + (2 * L2) + L3) / 6;

plot FilterL = if Laguerre <= 0
then p
else Laguerre;
FilterL.SetDefaultColor(Color.Orange);
}
Date Time Of Last Edit: 2016-10-25 16:41:38