Overall Statistics
Total Orders
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Start Equity
1000000
End Equity
1000000
Net Profit
0%
Sharpe Ratio
0
Sortino Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
-0.444
Tracking Error
0.16
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
Portfolio Turnover
0%
from AlgorithmImports import *
from QuantConnect.DataSource import *

class USEquitySecurityMasterAlgorithm (QCAlgorithm):

    def initialize(self):
        self.set_start_date(1998, 1, 1)
        self.set_cash(1000000)
        
        self.equity = self.add_equity("AAPL", Resolution.DAILY).symbol
        
    def on_data(self, slice: Slice) -> None:
        # Accessing Data - Splits
        split = slice.splits.get(self.equity)
        if split:
            self.debug(f"{self.time} >> SPLIT >> {split.symbol} - {split.split_factor} - {self.portfolio.cash} - {self.portfolio[self.equity].price}")
        
        # Accessing Data - Dividends
        dividend = slice.dividends.get(self.equity)
        if dividend:
            self.debug(f"{self.time} >> DIVIDEND >> {dividend.symbol} - {dividend.distribution} - {self.portfolio.cash} - {self.portfolio[self.equity].price}")

        # Accessing Data - Delisting
        delisting = slice.delistings.get(self.equity)
        if delisting:
            delistingType = {0: "Warning", 1: "Delisted"}.get(delisting.type)
            self.debug(f"{self.time} >> DELISTING >> {delisting.symbol} - {delistingType}")
            
        # Accessing Data - Symbol Changed Event
        symbolChangedEvent = slice.symbol_changed_events.get(self.equity)
        if symbolChangedEvent:
            self.debug(f"{self.time} >> SYMBOL CHANGED >> {symbolChangedEvent.old_symbol} -> {symbolChangedEvent.new_symbol}")