indicador primera señal

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #215934 quote
    nautilus23nautilus23
    Participant
    Average

    He preparado un indicador para marcar el primer cruce alcista del estocástico después de un cruce alcista de dos medias móviles, adjunto el codigo.

    IF Average[50](close) > Average[200](close) AND SmoothedStochastic[5,3](close) CROSSES OVER 20 THEN
    signal = 1
    ELSE
    signal = 0
    ENDIF
    RETURN signal AS "señal primera"
    

    El indicador funciona pero  marca todos los cruces por encima de 20 y a mi solo me interesa el primer cruce despues de que las dos medias se crucen. Adjunto imagen.

    ¿Alguien me puede ayudar a solucionarlo?

    Muchas gracias.

    2023-06-09_17h08_15.png 2023-06-09_17h08_15.png
    #215957 quote
    drubydruby
    Participant
    Junior

     

    //  https://www.prorealcode.com/topic/indicador-primera-senal/
    
    once smaSignal = 0
    once signal = 0
    
    IF Average[50](close) crosses over Average[200](close) then
    smaSignal = 1
    elsif Average[50](close) crosses under Average[200](close) then
    smaSignal = 0
    endif
    
    if smaSignal AND SmoothedStochastic[5,3](close) CROSSES OVER 20 THEN
    signal = 1
    smaSignal = 0
    ELSE
    signal = 0
    ENDIF
    
    RETURN signal AS "señal primera"
    nautilus23 thanked this post
    #215993 quote
    nautilus23nautilus23
    Participant
    Average

    Muchas gracias druby ha quedado perfecto.

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

indicador primera señal


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
nautilus23 @nautilus23 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by nautilus23nautilus23
3 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 06/09/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...