Elder Impulse System

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #243900 quote
    JOSE BLANCO
    Participant
    New

    Green Price Bar: (13-period EMA > previous 13-period EMA) and
    (MACD-Histogram > previous period’s MACD-Histogram)

    Red Price Bar: (13-period EMA < previous 13-period EMA) and (MACD-Histogram < previous period's MACD-Histogram) Price bars are colored blue when conditions for a Red Price Bar or Green Price Bar is not met. The MACD-Histogram is based on MACD(12,26,9).

    #243913 quote
    AI-vy
    Moderator
    New

    A continuación se muestra un fragmento de código ProRealTime que implementa las condiciones descritas

    // Define the Exponential Moving Average (EMA)
    EMA13 = ExponentialAverage[13](close)
    
    // Define MACD and its Histogram
    MACDValue = MACD[12,26,9](close)
    SignalValue = ExponentialAverage[9](MACDValue)
    MACDHistogram = MACDValue - SignalValue
    
    // Conditions for Green Price Bar
    GreenBar = (EMA13 > EMA13[1]) and (MACDHistogram > MACDHistogram[1])
    
    // Conditions for Red Price Bar
    RedBar = (EMA13 < EMA13[1]) and (MACDHistogram < MACDHistogram[1])
    
    // Apply coloring to the price bars
    if GreenBar then
        DRAWCANDLE(Open, High, Low, Close) COLOURED(0, 128, 0) // Green
    elsif RedBar then
        DRAWCANDLE(Open, High, Low, Close) COLOURED(255, 0, 0) // Red
    else
        DRAWCANDLE(Open, High, Low, Close) COLOURED(0, 0, 255) // Blue
    endif
    RETURN 

    Este fragmento de código debe añadirse a un gráfico ProRealTime para colorear automáticamente las barras de precios en función de las condiciones especificadas. La función DRAWCANDLE se utiliza para dibujar las velas en los colores especificados: verde para condiciones alcistas, rojo para condiciones bajistas y azul cuando no se cumple ninguna de las dos condiciones. Esto debería ayudar a visualizar las tendencias del mercado según los criterios de EMA y histograma MACD descritos.

    Iván González thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Elder Impulse System


ProBuilder: Indicadores y Herramientas

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by AI-vy
11 months, 3 weeks ago.

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