ERROR EN NDICADOR DE NICOLAS. Ayuda Please!

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #229521 quote
    gustavobp
    Participant
    New

    al intentar agregar este indiocador en prorealtime, creado por Nicolas, me da un error en la linea 19 y en la 19 haciendo referencia a Price. No entiendo cual es el error, creo que no me reconoce el comando Price:

    //PRC_ATR Adaptive EMA  | indicator
    //31.08.2018
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //converted from Metatrader5 version
     
    // --- settings
    EmaPeriod = 20
    // --- end of settings
     
    if barindex>EmaPeriod then
    price = customclose
    atr = averagetruerange[EmaPeriod]
    start = max(1,barindex-EmaPeriod+1)
    mmax = highest[start](atr)
    mmin = lowest[start](atr)
    coeff = 1-(atr-mmin)/(mmax-mmin)
    alpha = 2.0 / (1+EmaPeriod*(coeff+1.0)/2.0)
    val  = val[1]+alpha*(price-val[1])
    endif
     
    return val
    #229529 quote
    robertogozzi
    Moderator
    Master

    Reemplace la variable Price con Precio.

    #229530 quote
    JC_Bywan
    Moderator
    Master

    Buenos dias,

    Este código se creó en 2018. Pero mientras tanto, en 2022, “price” se ha convertido en una palabra reservada del lenguaje probuilder (para “set stop price”, “set target price”), ya no se puede elegir como nombre de variable personal. Puedes sustituirlo por “myprice”, por ejemplo, u otro nombre de tu elección, en las líneas 12 y 19.

    #229531 quote
    JC_Bywan
    Moderator
    Master

    ¡Roberto fue más rápido!

    robertogozzi thanked this post
    #229533 quote
    robertogozzi
    Moderator
    Master

    ¡Dos es siempre mejor que uno! 🙂

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

ERROR EN NDICADOR DE NICOLAS. Ayuda Please!


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
gustavobp @gustavobp Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by robertogozzi
2 years ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 03/09/2024
Status: Active
Attachments: No files
Logo Logo
Loading...