Dependencia de la misma variable un periodo antes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #202726 quote
    PMACIUN
    Participant
    New

    Hola,

    Mi intención es crear una variable que dependa de su valor en el pasado, es decir, algo así:

    A=AVERAGE[10](CLOSE)
    A1=A[1]
    B=B[1]+(A1-B[1])*1,5

    Donde A es la media de 10 velas, A1 es el valor de A en la vela anterior, y B dependa de su propio valor en la vela anterior y el valor de A1.

    ¿Cómo podría hacerse?

    Muchas gracias de antemano!

    Un saludo,

    #202728 quote
    robertogozzi
    Moderator
    Master

    Ahi esta:

    ONCE b = 0
    ONCE n = 10
    A=AVERAGE[n](CLOSE)
    if BarIndex > n then
       A1=A[1]
       B=B[1]+(A1-B[1])*1.5
    endif
    return B AS "B",A1 AS "A1" coloured(255,0,0,255)
    PMACIUN thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Dependencia de la misma variable un periodo antes


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
PMACIUN @pmaciun Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
3 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 10/17/2022
Status: Active
Attachments: No files
Logo Logo
Loading...