Computo de velas desde una fecha pasada

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #204968 quote
    robertogozzi
    Moderator
    Legend

    Reemplace la línea 6 con:

    variacionporcentual = ROC[max(1,count)](close)

    esto sucede porque al principio count=0, que no está permitido como un número de períodos.

    nautilus23 thanked this post
    #205017 quote
    nautilus23
    Participant
    Average
    Buenas tardes Roberto.
    He aplicado el indicador en un gráfico (adjunto imagen) poniendo como fecha de inicio del cálculo 20220103 y parece funcionar perfectamente, sin embargo no entiendo porqué también se presentan resultados anteriores a la fecha indicada. ¿Se podría evitar que salieron esos resultados anteriores?.
    Muchas gracias.
    2022-11-29_12h59_23.png 2022-11-29_12h59_23.png
    #205039 quote
    robertogozzi
    Moderator
    Legend

    Porque la variable variacionporcentual se debe poner a cero y se le debe asignar el valor solo DESDE la fecha indicada, por lo tanto se debe insertar dentro de IF…ENDIF:

    Once MyDate = 20220301
    Once Count = 0
    variacionporcentual = 0
    If OpenDate >= MyDate then
       Count = Count + 1
       variacionporcentual = ROC[max(1,count)](close)
    Endif
    Return variacionporcentual as "%"
    nautilus23 thanked this post
    #205071 quote
    nautilus23
    Participant
    Average

    Muchas gracias Roberto por la solución y por la explicación.

    Un saludo.

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Computo de velas desde una fecha pasada


ProScreener: Buscadores de Mercado y Rastreo

New Reply
Author
author-avatar
nautilus23 @nautilus23 Participant
Summary

This topic contains 18 replies,
has 3 voices, and was last updated by nautilus23
3 years, 9 months ago.

Topic Details
Forum: ProScreener: Buscadores de Mercado y Rastreo
Language: Spanish
Started: 07/26/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...