Can anyone help with the code logic. I am decent at coding, not an expert but I can work my way around. I am trying to do the following:
I have an indicator. Let's take for example I use the RVI indicator and I add the indicator three times using different values (50) (100) and (200) .
I want to set an alert or draw an arrow when the 50 crosses above both 100 and 200. It's pretty simple to just do
if (CrossAbove(... , ..., 1))
{
}
However, i want to put a logic where to only draw the arrow and set alert when it crosses not just in the last bar. The reason is because it could cross anytime, doesn't have to be in the last bar. I also want it so that if 100 is above 200 or 200 is above 100 doesn't matter as long as the 50 crosses above both.
Once that is confirmed then send the signal. When i do a CrossAbove or CrossBelow it looks back x number of bars. . . . i don't want to put x number of bars... . because it could happen in the last 100 bars. . .
let me know if this makes sense. . i included an image of the crosses i'm trying to capture.
Comment