problem with MACD cross over and new high break outs

Forums ProRealTime English forum ProBuilder support problem with MACD cross over and new high break outs

Viewing 6 posts - 1 through 6 (of 6 total)
  • #135825

    Hi

    I’ve been trying to write an indicator to highlight breakouts above 20 period highs but only those that have happened within 20 days after the cross of the MACD (highlight the start of a new trend). I can code the individual parameters but can’t work out how to combine them together.

    I was thinking that a loop looking back over the prior 20 days after each new 20 day high to check for a MACD cross would be a potential solution but I can’t work out how to code it.

    I would be grateful if someone could assist.

    Thanks

    Andrew

     

    #135852

    Do you want that at least 20 bars have elapsed after the Macd crossover?

    Or, if only say 12 bars have elapsed, then you want to retrieve the highest high of those 12 bars instead of 20?

    #135862

    Use SUMMATION.

     

    #135878

    There you go:

    This should do for 20- bars.

    #135880

    Vonasi’s code is much simpler!

    1 user thanked author for this post.
    #135943

    That’s exactly what I was looking for!

    Thanks for the help.

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login