Core
Command (Abstract Base Class)
Description: The
Command
class is an abstract base class (ABC) that defines the interface for all commands in the DSL.Constructor Parameters: None
Methods:
execute(self, data_provider)
: An abstract method that must be implemented by any subclass. This method will act on the command using the provideddata_provider
.
Open_Command
Retrieves the opening price of a market instrument for a specified date.
Constructor Parameters:
date (str)
: The date for which the open price is to be fetched.
Methods:
execute(self, data_provider)
: Callsdata_provider.get_open(self.date)
to retrieve the opening price for the specified date.
Example Usage:
High_Command
Retrieves the highest price of a market instrument for a specified date.
Constructor Parameters:
date (str)
: The date for which the high price is to be fetched.
Methods:
execute(self, data_provider)
: Callsdata_provider.get_high(self.date)
to retrieve the highest price for the specified date.
Example Usage:
Low_Command
Retrieves the lowest price of a market instrument for a specified date.
Constructor Parameters:
date (str)
: The date for which the low price is to be fetched.
Methods:
execute(self, data_provider)
: Callsdata_provider.get_low(self.date)
to retrieve the lowest price for the specified date.
Example Usage:
Close_Command
Retrieves the closing price of a market instrument for a specified date.
Constructor Parameters:
date (str)
: The date for which the close price is to be fetched.
Methods:
execute(self, data_provider)
: Callsdata_provider.get_close(self.date)
to retrieve the closing price for the specified date.
Example Usage:
Last updated