How to define only the first correction after the start of a new trend

Forums ProRealTime English forum ProScreener support How to define only the first correction after the start of a new trend

Viewing 13 posts - 1 through 13 (of 13 total)
  • #164796

    How to define the exclusive output of the first correction after the start of a new trend?

    Dear all!
    Unfortunately I am still quite inexperienced and I have no idea how to solve this. I am asking for the output of the first correction after the start of a new trend in the screener.
    Trend is defined as EMA 100 > EMA 200, as well as momentum higher timeframe. (that is clear)
    Correction is to be defined by a negative histogram for uptrends or vice versa.

    I want to avoid the output of further corrections in the trend, only the first correction should be relevant. I hope someone can possibly solve this. Many thanks in advance.

    #164799

    I tested it and it seems to work as expected:

     

    1 user thanked author for this post.
    #164802

    wow, that was really fast, thanks a lot! But as far as I can see I’m not getting the results I want, I only changed the code slightly because I am using a very slow macd (30/60/25). e.g. usdhuf, tf 1 hour, is returned as hit, but there is already the 4th correction (macd negative). But anyway I got an idea how I can fix this. Thanks a lot

    I used

     

    #164811

    I think i have to add a count so that the flags / histogram are counted while the trend is still present and an output only occurs when count = 1.

     

    #177977

    Hi guys, I haven’t dealt with this question for a while and would now like to try to get an answer. The above code does not give the desired results in the screener. The question would be the first correction defined as a MACD cross after the start of a trend, e.g. by an EMA cross. Unfortunately, my knowledge is not sufficient for this. Maybe someone has an idea.

    #177979

    Hello,
    Indeed you may need a count. Though the code of @robertogozzi looks good, I would try something like this (not tested):

    #177980

    Line 5 to line 17 makes perfect sense to me, but I don’t understand counting events logically.
    The suggested code unfortunately does not work and gives no results. It seems that the counting does not work.
    Thanks nevertheless!

     

    #178008

    Hello,
    To better know how the code works, you may start to develop an indicator to put on price that will show your signals. Then you will be able to screen more confidently I believe.

    PS: The screener may be SCREENER[CrossOver and MacdCross and Flag=1]

    #178012

    My code is working as expected, with any MACD setting you choose, as from my pic.

    Try increasing the units on your chart, an Ema200 will require many more bars than its periods to be correctly calculated. Use at least 1K bars.

     

    #178026

    I’m sorry, but I don’t think that’s the case.
    Attached is the screener, as well as the results in 4 hours.
    As an example USDCAD – it gives me every single correction, but only the very first is asked for.

    #178032

    Yes, you asked for the very first one in your first post “I am asking for the output of the first correction after the start of a new trend in the screener“.

     

    #178037

    Yes, indeed, and can write a code for a screener that gives me any correction, but I am not able to filter only the first correction after the start of a new trend – that is what I want to learn

    #178047

    This one will allow you to detect a) the first correction only or b) all corrections:

    simply change 1 to 0 in line 4 to detect ALL corrections.

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

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