Valor de indicadores en ventana de grafico de precio

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #213818 quote
    nautilus23
    Participant
    Average

    Buenos días.

    Mi pregunta es si se  puede  indicar en la ventana superior que representa el gráfico de precios el valor de los indicadores de manera similar al gráfico adjunto (En este caso la parte superior derecha, también sirve cualquier otro lugar de la ventana que representa el gráfico de precios).

    Muchas gracias por adelantado.

    #213903 quote
    robertogozzi
    Moderator
    Master

    Ahí tienes:

    DEFPARAM DrawOnLastBarOnly = True
    adxP  = 14
    rsiP  = 14
    atrP  = 14
    myADX = ADX[adxP]
    myATR = AverageTrueRange[atrP](close)
    myRSI = Rsi[rsiP](close)
    //--------------------------------------------------------------------------------------------------------------------
    drawrectangle(-120,0,-10,-20)                                  anchor(TopRight) coloured("Yellow",20) bordercolor("Green") style(line,2)
    drawtext ("RSI(#rsiP#)   #myRSI#", -66 ,-10, Dialog, Bold, 11) anchor(TopRight) coloured("Red")
    //
    drawrectangle(-120,-20,-10,-40)                                anchor(TopRight) coloured("Yellow",20) bordercolor("Green") style(line,2)
    drawtext ("ATR(#atrP#)   #myATR#", -68 ,-30, Dialog, Bold, 11) anchor(TopRight) coloured("Red")
    //
    drawrectangle(-120,-40,-10,-60)                                anchor(TopRight) coloured("Yellow",20) bordercolor("Green") style(line,2)
    drawtext ("ADX(#adxP#)  #myADX#", -69 ,-50, Dialog, Bold, 11)  anchor(TopRight) coloured("Red")
    return
    nautilus23 thanked this post
    #213949 quote
    nautilus23
    Participant
    Average

    Perfecto.

    Muchas gracias Roberto.

    Un saludo.

    #243178 quote
    Alfre
    Participant
    New

    Hola,

    sería posible representar esos datos ordenados por valor, por ejemplo descendente?

    #243202 quote
    robertogozzi
    Moderator
    Master

    Aquí está, es un poco complicado:

    DEFPARAM DrawOnLastBarOnly = True
    SortOrder   = 0    //1=Ascending order,   Any other Value=Descending order
    MaxElements = 3
    adxP        = 14
    rsiP        = 14
    atrP        = 14
    myADX       = ADX[adxP]
    myATR       = AverageTrueRange[atrP](close)
    myRSI       = Rsi[rsiP](close)
    $myVAL[1]   = myADX
    $myIND[1]   = 1    //1=ADX
    $myVAL[2]   = myATR
    $myIND[2]   = 2    //2=ATR
    $myVAL[3]   = myRSI
    $myIND[3]   = 3    //3=RSI
    IF SortOrder = 1 THEN
    //////////////////////////////////////////////////////////////////
    // (Bubble Sort) - ASCENDING order
    FOR i = 1 TO MaxElements - 1
    FOR j = 1 TO MaxElements - i
    IF $myVAL[j] >= $myVAL[j + 1] THEN
    // swap data
    temp          = $myVAL[j]
    $myVAL[j]     = $myVAL[j + 1]
    $myVAL[j + 1] = temp
    // swap labels
    temp          = $myIND[j]
    $myIND[j]     = $myIND[j + 1]
    $myIND[j + 1] = temp
    ENDIF
    NEXT
    NEXT
    ELSE
    //////////////////////////////////////////////////////////////////
    // (Bubble Sort) - DESCENDING order
    FOR i = 1 TO MaxElements - 1
    FOR j = 1 TO MaxElements - i
    IF $myVAL[j] < $myVAL[j + 1] THEN
    // swap data
    temp          = $myVAL[j]
    $myVAL[j]     = $myVAL[j + 1]
    $myVAL[j + 1] = temp
    // swap labels
    temp          = $myIND[j]
    $myIND[j]     = $myIND[j + 1]
    $myIND[j + 1] = temp
    ENDIF
    NEXT
    NEXT
    ENDIF
    //////////////////////////////////////////////////////////////////
    //--------------------------------------------------------------------------------------------------------------------
    drawrectangle(-120,0,-10,-20)                                      anchor(TopRight) coloured("Yellow",20) bordercolor("Green") style(line,2)
    FOR i = 1 TO 3
    //myValue = $myVAL[i]
    IF i = 1 THEN
    x = -66
    y = -10
    ELSIF i = 2 THEN
    x = -68
    y = -30
    ELSIF i = 3 THEN
    x = -69
    y = -50
    ENDIF
    IF $myIND[i] = 3 THEN
    drawtext ("RSI(#rsiP#) #myRSI#",x,y,Dialog,Bold, 11) anchor(TopRight) coloured("Red")
    ELSIF $myIND[i] = 2 THEN
    drawrectangle(-120,-20,-10,-40)                              anchor(TopRight) coloured("Yellow",20) bordercolor("Green") style(line,2)
    drawtext ("ATR(#atrP#) #myATR#",x,y,Dialog,Bold, 11) anchor(TopRight) coloured("Red")
    ELSIF $myIND[i] = 1 THEN
    drawrectangle(-120,-40,-10,-60)                              anchor(TopRight) coloured("Yellow",20) bordercolor("Green") style(line,2)
    drawtext ("ADX(#adxP#) #myADX#",x,y,Dialog,Bold, 11)  anchor(TopRight) coloured("Red")
    ENDIF
    NEXT
    return
    #243209 quote
    Alfre
    Participant
    New

    Muchísimas gracias, gran trabajo

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

Valor de indicadores en ventana de grafico de precio


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
nautilus23 @nautilus23 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Alfre
1 year ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 04/28/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...