Error al añadir el indicador “Laguerre Filter on price” en la plataforma V12

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #228897 quote
    Rua022
    Participant
    New
    Buenas tardes, he intentado añadir el indicador “Laguerre Filter on price” con el código correspondiente desde la web, (enlace: https://www.prorealcode.com/prorealtime-indicators/laguerre-filter-price/ ) , el problema es que al añadirlo me salta el siguiente mensaje:
    El código Probuilder de un indicador debe acabar siempre con la clave RETURN
    Me informan que aún que la instrucción de “Return” esté presente en el código, los problemas para utilizar el indicador son que en la línea 5 se utiliza la instrucción “Price” cuando esto ya es una función propia del lenguaje y no se puede utilizar como variable, y que los elementos “Length” y “Elements” no están definidos en el código.
    No tengo conocimientos para repararlo, alguien que pueda ayudarme con ello, muchas gracias y un saludo.
    #228907 quote
    druby
    Participant
    New
    //parameters :
    length = 20
    Elements = 5
    
    mPrice = (High+Low+Open+Close)/4
    
    Diff = ABS(mPrice - Filt[1])
    HH = Diff
    LL = Diff
    FOR count = 0 TO Length - 1
    IF Diff[count] > HH THEN
    HH = Diff[count]
    ENDIF
    IF Diff[count] < LL THEN
    LL = Diff[count]
    ENDIF
    NEXT
    
    If Barindex > Length AND HH - LL <> 0 THEN
    Calcul = (Diff - LL) / (HH - LL)
    // Calculate MEDIAN with 5 Elements. Vary at will
    Data = Calcul
    NrElements = Elements
    FOR X = 0 TO NrElements-1
    M = Data[X]
    SmallPart = 0
    LargePart = 0
    FOR Y = 0 TO NrElements-1
    IF Data[Y] < M THEN
    SmallPart = SmallPart + 1
    ELSIF Data[Y] > M THEN
    LargePart = LargePart + 1
    ENDIF
    IF LargePart = SmallPart AND Y = NrElements-1 THEN
    Median = M
    BREAK
    ENDIF
    NEXT
    NEXT
    
    alpha = Median
    
    L0 = alpha*mPrice + (1 - alpha)*L0[1]
    L1 = -(1 - alpha)*L0 + L0[1] + (1 - alpha)*L1[1]
    L2 = -(1 - alpha)*L1 + L1[1] + (1 - alpha)*L2[1]
    L3 = -(1 - alpha)*L2 + L2[1] + (1 - alpha)*L3[1]
    
    FILT = (L0 + 2*L1 + 2*L2 + L3) / 6
    ENDIF
    
    
    IF Barindex < 1 THEN
    FILT = mPrice
    ENDIF
    
    RETURN Filt AS "Laguerre1"
    
    robertogozzi, Iván González and Rua022 thanked this post
    #228920 quote
    Rua022
    Participant
    New

    Thanks you very much for the information

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Error al añadir el indicador “Laguerre Filter on price” en la plataforma V12


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Rua022 @rua022 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Rua022
1 year, 11 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 02/27/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...