Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
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
Tracking Error
0
Treynor Ratio
0
Total Fees
$0.00
class AdjustmentTest(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2012, 1, 1)
        self.SetEndDate(2012, 1, 8)
        self.SetCash(15000)

        # Constant definitions
        self.ASSET_UNDERLYING = 'SPY'
        self.ASSET_TRADE_LONG = 'AAPL'

        # Initialization process
        self._asset_underlying = self.AddEquity(self.ASSET_UNDERLYING, Resolution.Minute)
        self._asset_trade_long = self.AddEquity(self.ASSET_TRADE_LONG, Resolution.Minute)

        self._asset_underlying.SetDataNormalizationMode(DataNormalizationMode.Raw)
        self._asset_trade_long.SetDataNormalizationMode(DataNormalizationMode.Raw)

        self.Schedule.On(
            self.DateRules.EveryDay(self.ASSET_UNDERLYING),
            self.TimeRules.BeforeMarketClose(self.ASSET_UNDERLYING, 1),
            Action(self._print)
        )

    def _print(self):
        # Get all historic quotes
        underlying_price = float(self.Securities[self.ASSET_UNDERLYING].Close)
        # long_price = float(self.Securities[self.ASSET_TRADE_LONG].Close)
        self.Log('%s price: %.04f' % (self.ASSET_UNDERLYING, underlying_price))
        # self.Log('%s price: %.04f' % (self.ASSET_TRADE_LONG, long_price))