Skip to content

EnergyETFUniverse

QuantConnect.Algorithm.Framework.Selection.EnergyETFUniverse

EnergyETFUniverse()

Bases: InceptionDateUniverseSelectionModel

Universe Selection Model that adds the following Energy ETFs at their inception date 1998-12-22 XLE Energy Select Sector SPDR Fund 2000-06-16 IYE iShares U.S. Energy ETF 2004-09-29 VDE Vanguard Energy ETF 2006-04-10 USO United States Oil Fund 2006-06-22 XES SPDR S&P Oil & Gas Equipment & Services ETF 2006-06-22 XOP SPDR S&P Oil & Gas Exploration & Production ETF 2007-04-18 UNG United States Natural Gas Fund 2008-06-25 ICLN iShares Global Clean Energy ETF 2008-11-06 ERX Direxion Daily Energy Bull 3X Shares 2008-11-06 ERY Direxion Daily Energy Bear 3x Shares 2008-11-25 SCO ProShares UltraShort Bloomberg Crude Oil 2008-11-25 UCO ProShares Ultra Bloomberg Crude Oil 2009-06-02 AMJ JPMorgan Alerian MLP Index ETN 2010-06-02 BNO United States Brent Oil Fund 2010-08-25 AMLP Alerian MLP ETF 2011-12-21 OIH VanEck Vectors Oil Services ETF 2012-02-08 DGAZ VelocityShares 3x Inverse Natural Gas 2012-02-08 UGAZ VelocityShares 3x Long Natural Gas 2012-02-15 TAN Invesco Solar ETF

Initializes a new instance of the EnergyETFUniverse class

instance

instance: Any

Gets the underlying python instance

This codeEntityType is protected.

PythonRuntimeChecker

Bases: Object

Set of helper methods to invoke Python methods with runtime checks for return values and out parameter's conversions.

create_universes

create_universes(
    algorithm: QCAlgorithm,
) -> Iterable[Universe]

Creates the universes for this algorithm. Called at algorithm start.

Returns:

Type Description
Iterable[Universe]

The universes defined by this model.

get_next_refresh_time_utc

get_next_refresh_time_utc() -> datetime

Gets the next time the framework should invoke the CreateUniverses method to refresh the set of universes.

equals

equals(obj: Any) -> bool
equals(
    other: BasePythonWrapper[
        QuantConnect_Python_BasePythonWrapper_TInterface
    ],
) -> bool

Signature descriptions:

  • Determines whether the specified object is an instance of BasePythonWrapper{TInterface} and wraps the same Python object reference as this instance, which would indicate that they are equal.

  • Determines whether the specified instance wraps the same Python object reference as this instance, which would indicate that they are equal.

Parameters:

Name Type Description Default
obj Optional[Any]

The other object to compare this with

None
other Optional[BasePythonWrapper[QuantConnect_Python_BasePythonWrapper_TInterface]]

The other object to compare this with

None

Returns:

Type Description
bool

True if both instances are equal, that is if both wrap the same Python object reference.

set_python_instance

set_python_instance(instance: Any) -> None
set_python_instance(
    instance: Any, validate_interface: bool
) -> None

Signature descriptions:

  • Sets the python instance

  • Sets the python instance and sets the validate interface flag

Parameters:

Name Type Description Default
instance Any

The underlying python instance

required
validate_interface Optional[bool]

Whether to perform validations for interface implementation

None

dispose

dispose() -> None

Dispose of this instance

get_event

get_event(name: str) -> Any

Gets the Python instance event with the specified name

Parameters:

Name Type Description Default
name str

The name of the event

required

get_hash_code

get_hash_code() -> int

Gets the hash code for the current instance

Returns:

Type Description
int

The hash code of the current instance.

get_method

get_method(
    method_name: str, python_only: bool = False
) -> Any

Gets the Python instances method with the specified name and caches it

Parameters:

Name Type Description Default
method_name str

The name of the method

required
python_only bool

Whether to only return python methods

False

Returns:

Type Description
Any

The matched method.

get_property

get_property(property_name: str) -> Any

Gets the Python instance property with the specified name

Parameters:

Name Type Description Default
property_name str

The name of the property

required

has_attr

has_attr(name: str) -> bool

Determines whether the Python instance has the specified attribute

Parameters:

Name Type Description Default
name str

The attribute name

required

Returns:

Type Description
bool

Whether the Python instance has the specified attribute.

invoke_method

invoke_method(
    method_name: str, *args: Union[Object, Iterable[Object]]
) -> Any

Invokes the specified method with the specified arguments

Parameters:

Name Type Description Default
method_name str

The name of the method

required
args Union[Object, Iterable[Object]]

The arguments to call the method with

()

invoke_void_method

invoke_void_method(
    method_name: str, *args: Union[Object, Iterable[Object]]
) -> None

Invokes the specified method with the specified arguments without returning a value

Parameters:

Name Type Description Default
method_name str

The name of the method

required
args Union[Object, Iterable[Object]]

The arguments to call the method with

()

set_property

set_property(property_name: str, value: Any) -> None

Sets the Python instance property with the specified name

Parameters:

Name Type Description Default
property_name str

The name of the property

required
value Any

The property value

required

select

select(
    algorithm: QCAlgorithm, date: Union[datetime, date]
) -> Iterable[str]

Returns all tickers that are trading at current algorithm Time

to_string

to_string() -> str

Returns a string that represents the current object