Is there a simple way to determine a trend and calculate it programatically?
For example I am looking at 2min candles on ES, I want to know if the overall trend is going up or down, so I plot a 20 day SMA. Now I can see with my eye that it seems to slope down today, so its in a down trend. But the sharp reversal that happened at Mondays open on Sunday evening how do you calculate that?
I was thinking take the last SMA and take a SMA 5 periods before and 10 periods before. If the 10 > 5 > 1 then we are in clear downtrend. if 10 < 5 > 1 we had a reversal? Etc.
Im sure there is an indicator for this, or a better way to do it? Perhaps something that considers volume too, if we drop in price on low volume weight that very highly as a downtrend. Vs a drop in price on large volume weight that low as that can easily rebound.
For example I am looking at 2min candles on ES, I want to know if the overall trend is going up or down, so I plot a 20 day SMA. Now I can see with my eye that it seems to slope down today, so its in a down trend. But the sharp reversal that happened at Mondays open on Sunday evening how do you calculate that?
I was thinking take the last SMA and take a SMA 5 periods before and 10 periods before. If the 10 > 5 > 1 then we are in clear downtrend. if 10 < 5 > 1 we had a reversal? Etc.
Im sure there is an indicator for this, or a better way to do it? Perhaps something that considers volume too, if we drop in price on low volume weight that very highly as a downtrend. Vs a drop in price on large volume weight that low as that can easily rebound.