Medir distancia entre la media móvil simple y el cierre de la vela

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #247576 quote
    Roberto CifreRoberto Cifre
    Participant
    New

    Necesito que aparezca en el gráfico cerca de la vela última alcista la distancia entre el cierre (arriba) y la media móvil simple de 20 periodos (lo más cerca de ésta)

    y en porcentaje.

    Muchas gracias

    #247592 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    El foro correcto no es ProOrder, sino ProBuilder, ya que es un indicador, no una estrategia automatizada.
    Lo moví, pero por favor lea las reglas principales indicadas a continuación en el cuadro amarillo. Gracias 🙂

    Ahí está:

    DEFPARAM DrawOnLastBarOnly = true
    Sma20 = average[20,0](close)
    VelaAlcista = close > open
    IF VelaAlcista THEN
       Barra  = BarIndex
       Precio = high
    ENDIF
    Distancia  = Sma20 - Precio
    Porcentaje = round(Distancia * 100 / Precio,1)
    Drawtext("Distancia: ",Barra,Precio * 1.010,Dialog,standard,15)
    Drawtext("#Porcentaje#%",Barra,Precio * 1.005,Dialog,standard,15)
    RETURN
    Iván González thanked this post
    #247609 quote
    Roberto CifreRoberto Cifre
    Participant
    New

    Tendré en cuenta la clase de foro del post

    Muchas gracias Iván

Viewing 3 posts - 1 through 3 (of 3 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

Medir distancia entre la media móvil simple y el cierre de la vela


ProOrder: Trading Automático y Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Roberto CifreRoberto Cifre
1 year, 3 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 05/24/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...