Screener para Nadaraya Watson

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #201074 quote
    sanchota
    Participant
    New

    Hola estoy intentando hacer un screener para el indicador Nadaraya watson.

    Al ejecutarlo me pone que error de sintaxis en la linea 19 ,caracter 11.Complete la sintaxis de esta linea.

    //Nadaraya-Watson Envelope
    length = 21 //Window Size
    hh = 8 //Bandwidth
    mult = 2
    src = CustomClose
    n = barindex
    k = 2
    //if IsLastBarUpdate and barindex>length then
    //y = 0
    sume = 0
    for i = 0 to length-1
    sum = 0
    sumw = 0
    
    for j = 0 to length-1
    w = exp(-(pow(i-j,2)/(hh*hh*2)))
    sum = sum+src[j]*w
    sumw = sumw+w
    next
    y2 = sum/sumw
    sume = sume+abs(src[i] - y2)
    //array.push(y,y2)
    next
    mae = sume/length*mult
    /*drawpoint(barindex,y2,1)
    drawpoint(barindex,y2+mae,1)
    drawpoint(barindex,y2-mae,1)*/
    //endif
    C1 = src crosses over y2-mae
    
    screener [C1]

     

    ¿Que es lo que falla?

    Gracias por responder.

    NADARAYA_WATSON.itf
    #201090 quote
    Nicolas
    Keymaster
    Master

    Porque ha utilizado una nueva instrucción POW que aún no es compatible con ProScreener. Sin embargo, lo he reemplazado con el SQUARE, porque era una potencia de 2.

    //Nadaraya-Watson Envelope
    length = 21 //Window Size
    hh = 8 //Bandwidth
    mult = 2
    src = CustomClose
    //n = barindex
    //k = 2
    //if IsLastBarUpdate and barindex>length then
    //y = 0
    sume = 0
    for i = 0 to length-1
    sum = 0
    sumw = 0
    
    for j = 0 to length-1
    w = exp(-(square(i-j)/(hh*hh*2)))
    sum = sum+src[j]*w
    sumw = sumw+w
    next
    y2 = sum/sumw
    sume = sume+abs(src[i] - y2)
    //array.push(y,y2)
    next
    mae = sume/length*mult
    /*drawpoint(barindex,y2,1)
    drawpoint(barindex,y2+mae,1)
    drawpoint(barindex,y2-mae,1)*/
    //endif
    C1 = src crosses over y2-mae
    
    screener [C1]
    
    #201095 quote
    sanchota
    Participant
    New

    Muchas gracias Nicolas.

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

Screener para Nadaraya Watson


ProScreener: Buscadores de Mercado y Rastreo

New Reply
Author
author-avatar
sanchota @sanchota Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by sanchota
3 years, 5 months ago.

Topic Details
Forum: ProScreener: Buscadores de Mercado y Rastreo
Language: Spanish
Started: 09/20/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...