Cambiar indicador en función de la vista temporal

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

    ¿Existe alguna forma de modificar un parámetro de un indicador en función de la vista temporal aplicada?

    Por ejemplo, un parámetro P que valga 52 en vista semanal y que valga 252 en vista diaria.

    Para no tener que cargar 2 indicadores distintos, uno para semanal y otro para diario.

    #244651 quote
    robertogozzi
    Moderator
    Master

    Allí está:

    /*
    GetTimeFrame devuelve los segundos:
    60 = 1 minute
    300 = 5 minutes
    3600 = 1 hour
    14400 = 4 hours
    86400 = 1 day      (24 hours)
    604800 = 1 week    (7  days)
    2592000 = 1 month  (30 days)
    31536000 = 1 year  (365 days)
    -1 = default TF (or non time based TF)
    */
    TF = GetTimeFrame
    IF TF = 86400 THEN      // TF diario
       P = 252
    ELSIF TF = 604800 THEN
       P = 52               // TF Semanal
    ENDIF
    
    Iván González thanked this post
    #244653 quote
    Aquaris
    Participant
    New

    Muchas gracias Roberto!

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

Cambiar indicador en función de la vista temporal


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Aquaris @aquaris Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 03/04/2025
Status: Active
Attachments: No files
Logo Logo
Loading...