Dependencia de la misma variable un periodo antes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #202726 quote
    PMACIUNPMACIUN
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
3 years, 11 months ago.

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