Indicador Gap down

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

    Hola,

    Me gustaría poder obtener un indicador con las próximas condiciones:

    1- El precio de hoy es menor que el low del día anterior. Es decir hay un gap down.

    2- Si se cumple la primera condición se busca lo siguiente: cuando el precio toque de nuevo ese low previo al gap down se compra (debe ser un día posterior al gap down). Me gustaría que el resultado fuese 1 si es compra. No tengo el pro así que me imagino que no podré poner stop limit de 3 euros.

    3- Se vende en el día que hay ganancia. Es decir, si compro hoy a 60 y mañana esta a 61 lo vendo. Me gustaría que el resultado fuese -1 si es venta.

    4- Stop loss de 20 %

    Gracias de antemano,

    Un saludo

    #245393 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Sería algo así:

    //1- El precio de hoy es menor que el low del día anterior. Es decir hay un gap down.
    GapDown=open<low[1] // esto sería si estamos en un timeframe diario
    
    //2- Si se cumple la primera condición se busca lo siguiente: cuando el precio toque de nuevo ese low previo al gap down se compra (debe ser un día posterior al gap down). Me gustaría que el resultado fuese 1 si es compra. No tengo el pro así que me imagino que no podré poner stop limit de 3 euros.
    if GapDown and close< low[1] then
    gapDetectado=1
    nivelGap=low[1]
    else
    gapDetectado=0
    endif
    
    if enPosicion=0 and gapDetectado[1] and high>nivelGap then
    enPosicion=1
    precioEntrada=max(open,nivelGap)
    Stoploss=precioEntrada*0.8
    resultado=1
    baridx=barindex
    drawarrowup(baridx,low)coloured("green")
    drawpoint(baridx,precioEntrada,2)coloured("blue")
    drawsegment(barindex[1],nivelGap,barindex+1,nivelGap)style(dottedline)coloured("purple")
    drawtext("✖",barindex[2],low[2])coloured("red")
    
    elsif enPosicion=0 and gapDetectado[1] then
    drawsegment(barindex[1],nivelGap,barindex+1,nivelGap)style(dottedline)coloured("purple")
    drawtext("✖",barindex[2],low[2])coloured("red")
    endif
    //3- Se vende en el día que hay ganancia. Es decir, si compro hoy a 60 y mañana esta a 61 lo vendo. Me gustaría que el resultado fuese -1 si es venta.
    //4- Stop loss de 20 %
    if enPosicion=1 then
    
    if open>precioEntrada then
    precioSalida=open
    resultado=-1
    enPosicion=0
    gapDetectado=0
    
    drawpoint(barindex,precioSalida,2)coloured("blue")
    drawsegment(baridx,precioEntrada,barindex,precioEntrada)style(dottedline)coloured("blue")
    drawsegment(baridx,precioSalida,barindex,precioSalida)style(dottedline)coloured("green")
    drawsegment(baridx,stoploss,barindex,stoploss)style(dottedline)coloured("red")
    
    elsif low<=stoploss then
    precioSalida=min(open,stoploss)
    resultado=-1
    enPosicion=0
    gapDetectado=0
    
    drawpoint(barindex,precioSalida,2)coloured("blue")
    drawsegment(baridx,precioEntrada,barindex,precioEntrada)style(dottedline)coloured("blue")
    drawsegment(baridx,precioSalida,barindex,precioSalida)style(dottedline)coloured("green")
    drawsegment(baridx,stoploss,barindex,stoploss)style(dottedline)coloured("red")
    
    endif
    endif
    
    return
    robertogozzi 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

Indicador Gap down


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Azkune @azkune Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
1 year, 5 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 03/27/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...