Understanding the Speed Oscillator: A Key Indicator for MetaTrader 5

Mike 2021.06.20 22:50 15 0 0
Attachments

Description

The Speed Oscillator is a handy tool that measures the current bar's Moving Average Speed compared to the average speed of the last # bars. It's a great way to gauge market momentum and can help you make more informed trading decisions.

If you're looking for a visual representation of this oscillator, check out the Speed Indicator.


How It Works

Current Bar's speed / Mean speed of past # bars

The calculations behind the Speed Oscillator are straightforward:

         AvgPosBuffer[i] = pos_sum / InpSPeriod; 
         AvgNegBuffer[i] = neg_sum / InpSPeriod; 

         if (ExtMABuffer[i] - ExtMABuffer[i-1] > 0) { 
            SO[i] = (ExtMABuffer[i] - ExtMABuffer[i-1]) / AvgPosBuffer[i]; 
         } else if (ExtMABuffer[i] - ExtMABuffer[i-1] < 0) { 
            SO[i] = -((ExtMABuffer[i] - ExtMABuffer[i-1]) / AvgNegBuffer[i]); 
         } else { 
            SO[i] = 0; 
         }

Example

To illustrate how the Speed Oscillator operates, let’s consider a setup:

Moving Average (9)

Averaging Period (120)

Example of Speed Oscillator

List
Comments 0