Crosses under/over question

Forums ProRealTime English forum ProOrder support Crosses under/over question

Viewing 8 posts - 1 through 8 (of 8 total)
  • #101950
    CKW

    hi,

    How do you code “close crosses over/under X” to handle X value will be changing from top to down or vice-versa?

    e.g.

    From chart, close price has never cross over/under old trend or new trend. But in coding, “close crosses under Trend” is executed as true. I want it to stay false.

    can you please help?

    br,

    CKW

     

    #101955

    Cross Over is when then previous price was < “your_indicator” while now it’s above it.

    Cross Under is the other way round.

    is the same as:

    “your_indicator” can be any indicator, or price (On DAX it could be 12650) or a S/R level or whatever else you need to detect when it’s being crossed over.

    CLOSE is most commonly used, but you can replace it by HIGH, LOW, and so on… depending on what suits best your needs.

    #101958
    CKW

    Hi Robertozzi,

    Thanks for your reply. But it’s not my question.

    I know how to use cross under/over for typical case it but in certain case, it just do not work. From my first attached picture, close price has never cross these lines but when the trend line change from top – down, the “close crosses under trendline” will become true. In reality, it should false as no crosses never happen.

    Do you know how to solve it?

    br,

    CKW

     

     

     

    #101959

    There’s been a CROSS UNDER.

    You can easily GRAPH those values, candle by candle, to detect it.

    #101961

    I don’t know how you are defining the “new trend”, but just simply don’t test crosses over/under when a newtrend occur on the same bar/period.

    #101964

    This is a SuperTrend CROSSOVER.

    #101966
    CKW

    Hi Nicholas,

    yes. I think that’s only the way, I have tried few solution but it does not work.

    thanks

    br,

    CKW

    #101975

    You could simply just check if the trend line is between any bars high and low. If it is then price has crossed within that bar. You may want to then check on the next bar that the close is still on the same expected side of the trend line.

     

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

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