I’m using two exponential moving averages (30EMA and 50 EMA). My question is how do I code to check the distance between the 30EMA and 50EMA is less than 20 PIPS over the last 20 bars, and the 30 EMA has remained above the 50 EMA over the same period, i.e. last 20 bars?
Ideally I want to be able to control the distance between the two EMA’s, 20 PIPs was an example. The main aim is not to see the two ema’s drift wider and wider apart.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue