Horquilla en la que se cumple una condición.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #230956 quote
    M.Nicolas 81
    Participant
    Average

    Hola,

    Estoy intentando que el indicador me marque cuando la 13EMA se encuentra por encima de 26EMA entre 15 y 75 periodos. Para ello utilizo el código que adjunto, pero solo me devuelve cuando es superior, sin tener en cuenta la horquilla de periodos seleccionada.

    Alguien puede ayudarme?.

    Gracias.

    REM
    
    C1=ExponentialAverage[13](close)
    C2=ExponentialAverage[26](close)
    
    HORQUILLA=0
    
    MEDIAS= C1 > C2
    SUPERIOR= C1 > C2
    FOR I=15 TO 75 DO
    IF I AND SUPERIOR THEN
    HORQUILLA=1
    BREAK
    ENDIF
    NEXT
    RETURN SUPERIOR AS "SUPERIOR"
    
    #230989 quote
    Iván González
    Moderator
    Master

    Hola.
    Este indicador devolverá 1 si la ema13 lleva por encima de la ema26 más de 14 periodos y menos de 76.

    ema1 = exponentialaverage[13](close)
    ema2 = exponentialaverage[26](close)
    
    if ema1 > ema2 then
    n=n+1
    else
    n=0
    endif
    
    horquilla = n>=15 and n<=75
    
    return horquilla
    M.Nicolas 81 thanked this post
    #230997 quote
    M.Nicolas 81
    Participant
    Average

    Muchas gracias Iván,

    Te sigo desde hace años, un lujazo tenerte aquí.

    Funciona perfectamente .

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

Horquilla en la que se cumple una condición.


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
M.Nicolas 81 @pitlin Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by M.Nicolas 81
1 year, 10 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 04/03/2024
Status: Active
Attachments: No files
Logo Logo
Loading...