Crosses under/over question
Forums › ProRealTime English forum › ProOrder support › Crosses under/over question
- This topic has 7 replies, 4 voices, and was last updated 6 years ago by
Vonasi.
-
-
07/04/2019 at 10:23 AM #101950
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
07/04/2019 at 10:39 AM #101955Cross Over is when then previous price was < “your_indicator” while now it’s above it.
Cross Under is the other way round.
1IF close CROSSES OVER "your_indicator" THENis the same as:
1IF close[1] < "your_indicator" and close > "your_indicator" THEN“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.
07/04/2019 at 10:49 AM #101958Hi 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
07/04/2019 at 11:05 AM #101959There’s been a CROSS UNDER.
You can easily GRAPH those values, candle by candle, to detect it.
07/04/2019 at 11:07 AM #10196107/04/2019 at 11:16 AM #101964This is a SuperTrend CROSSOVER.
07/04/2019 at 11:16 AM #10196607/04/2019 at 2:25 PM #101975You 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.
-
AuthorPosts
Find exclusive trading pro-tools on