|
| 1 | +# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. |
| 2 | +# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +from clr import AddReference |
| 15 | +AddReference("System") |
| 16 | +AddReference("QuantConnect.Algorithm") |
| 17 | +AddReference("QuantConnect.Indicators") |
| 18 | +AddReference("QuantConnect.Common") |
| 19 | + |
| 20 | +from System import * |
| 21 | +from QuantConnect import * |
| 22 | +from QuantConnect.Data import * |
| 23 | + |
| 24 | +### <summary> |
| 25 | +### Benchmark Algorithm: The minimalist basic template algorithm benchmark strategy. |
| 26 | +### </summary> |
| 27 | +### <remarks> |
| 28 | +### All new projects in the cloud are created with the basic template algorithm. It uses a minute algorithm |
| 29 | +### </remarks> |
| 30 | +class BasicTemplateBenchmark(QCAlgorithm): |
| 31 | + |
| 32 | + def Initialize(self): |
| 33 | + self.SetStartDate(2000, 1, 1) |
| 34 | + self.SetEndDate(2017, 1, 1) |
| 35 | + self.SetBenchmark(lambda x: 1) |
| 36 | + self.AddEquity("SPY") |
| 37 | + |
| 38 | + def OnData(self, data): |
| 39 | + self.SetHoldings("SPY", 1) |
| 40 | + self.Debug("Purchased Stock") |
0 commit comments