Indicator Reference

Ease Of Movement Value

Introduction

This indicator computes the n-period Ease of Movement Value using the following: MID = (high_1 + low_1)/2 - (high_0 + low_0)/2 RATIO = (currentVolume/10000) / (high_1 - low_1) EMV = MID/RATIO _SMA = n-period of EMV Returns _SMA source

Create Manual Indicators

You can manually create a EaseOfMovementValue indicator, so it doesn’t automatically update. Manual indicators let you update their values with any data you choose. The following reference table describes the EaseOfMovementValue constructor.

EaseOfMovementValue()1/2

            EaseOfMovementValue QuantConnect.Indicators.EaseOfMovementValue (
     *int  scale
   )
        

Initializeds a new instance of the EaseOfMovement class using the specufued period.

EaseOfMovementValue()2/2

            EaseOfMovementValue QuantConnect.Indicators.EaseOfMovementValue (
     string  name,
     int     scale
   )
        

Creates a new EaseOfMovement indicator with the specified period.

Update Manual Indicators

You can update the indicator automatically or manually.

Automatic Update

To register a manual indicator for automatic updates with the security data, call the RegisterIndicator method.


private EaseOfMovementValue _emv;

// In Initialize()
_emv = new EaseOfMovementValue(name, period, scale);
_emv.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _emv, Resolution.Daily);

// In IndicatorUpdateMethod()
if (_emv.IsReady)
{
    var indicatorValue = _emv.Current.Value;
}
    
# In Initialize()
self.emv = EaseOfMovementValue(name, period, scale)
self.emv.Updated += self.IndicatorUpdateMethod

self.RegisterIndicator(symbol, self.emv, Resolution.Daily)

# In IndicatorUpdateMethod()
if self.emv.IsReady:
    indicator_value = self.emv.Current.Value

To customize the data that automatically updates the indicator, see Custom Indicator Periods and Custom Indicator Values.

Manual Update

Updating your indicator manually enables you to control when the indicator is updated and what data you use to update it. To manually update the indicator, call the Update method with a TradeBar. The indicator will only be ready after you prime it with enough data.

    
private EaseOfMovementValue _emv;
private Symbol symbol;

// In Initialize()
_emv = new EaseOfMovementValue(period, scale);
symbol = AddEquity("SPY").Symbol;

// In OnData()
if (data.Bars.ContainsKey(_symbol))
{
    _emv.Update(data.Bars[symbol]);
}
if (_emv.IsReady)
{
    var indicatorValue = _emv.Current.Value;
}
    
# In Initialize()
self.emv = EaseOfMovementValue(period, scale)
self.symbol = self.AddEquity("SPY").Symbol

# In OnData()
if data.Bars.ContainsKey(self.symbol):
    self.emv.Update(data.Bars[self.symbol])
if self.emv.IsReady:
    indicator_value = self.emv.Current.Value

Create Automatic Indicators

The EMV method creates an EaseOfMovementValue indicator, sets up a consolidator to update the indicator, and then returns the indicator so you can use it in your algorithm.

The following reference table describes the EMV method:

EMV()1/1

            EaseOfMovementValue QuantConnect.Algorithm.QCAlgorithm.EMV (
    Symbol                            symbol,
    *Int32                            period,
    *Int32                            scale,
    *Nullable<Resolution>       resolution,
    *Func<IBaseData, TradeBar>  selector
   )
        

Creates an EaseOfMovementValue indicator for the symbol. The indicator will be automatically updated on the given resolution.


If you don't provide a resolution, it defauls to the security resolution. If you provide a resolution, it must be greater than or equal to the resolution of the security. For instance, if you subscribe to hourly data for a security, you should update its indicator with data that spans 1 hour or longer.

For more information about the selector argument, see Alternative Price Fields.

Get Indicator Values

To get the value of the indicator, use its Current.Value attribute.

private EaseOfMovementValue _emv;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_emv = EMV(symbol);

// In OnData()
if (_emv.IsReady)
{
    var current = _emv.Current.Value;
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.emv = self.EMV(symbol)

# In OnData()
if self.emv.IsReady:
    current = self.emv.Current.Value

Visualization

To plot indicator values, in the OnData event handler, call the Plot method.

private EaseOfMovementValue _emv;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_emv = EMV(symbol);

// In OnData()
if (_emv.IsReady)
{
    Plot("My Indicators", "easeofmovementvalue", _emv.Current);
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.emv = self.EMV(symbol)

# In OnData()
if self.emv.IsReady:
    self.Plot("My Indicators", "easeofmovementvalue", self.emv.Current)

For more information about plotting indicators, see Plotting Indicators.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: