@@ -68,12 +68,17 @@ public override void Initialize()
6868 SetStartDate ( 2024 , 9 , 1 ) ;
6969 SetEndDate ( 2024 , 12 , 31 ) ;
7070 SetCash ( 100000 ) ;
71+ // AutomaticIndicatorWarmUp only supports automatic indicators, not manual indicators.
7172 Settings . AutomaticIndicatorWarmUp = true ;
7273 var tickers = new string [ ] { "SPY" , "QQQ" , "IWM" } ;
7374 foreach ( var ticker in tickers )
7475 {
7576 dynamic equity = AddEquity ( ticker ) ;
7677 equity . Macd = MACD ( equity , 12 , 26 , 9 , MovingAverageType . Exponential , Resolution . Daily ) ;
78+ // Alternatively, use a manual indicator.
79+ // equity.Macd = new MovingAverageConvergenceDivergence(12, 26, 9, MovingAverageType.Exponential);
80+ // WarmUpIndicator<IndicatorDataPoint>(equity.Symbol, equity.Macd, Resolution.Daily);
81+ // RegisterIndicator(equity.Symbol, equity.Macd, Resolution.Daily);
7782 PlotIndicator ( ticker , equity . Macd ) ;
7883 }
7984 Schedule . On ( DateRules . EveryDay ( "SPY" ) , TimeRules . AfterMarketOpen ( "SPY" , 1 ) , Rebalance ) ;
@@ -96,4 +101,4 @@ private void Rebalance()
96101 }
97102 }
98103 }
99- }
104+ }
0 commit comments