|
| 1 | +/* |
| 2 | + * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. |
| 3 | + * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | + * See the License for the specific language governing permissions and |
| 13 | + * limitations under the License. |
| 14 | +*/ |
| 15 | + |
| 16 | +using System.Runtime.CompilerServices; |
| 17 | + |
| 18 | +namespace QuantConnect |
| 19 | +{ |
| 20 | + /// <summary> |
| 21 | + /// Provides user-facing message construction methods and static messages for the <see cref="Algorithm"/> namespace |
| 22 | + /// </summary> |
| 23 | + public static partial class Messages |
| 24 | + { |
| 25 | + /// <summary> |
| 26 | + /// Provides user-facing messages for the <see cref="Algorithm.QCAlgorithm"/> class and its consumers or related classes |
| 27 | + /// </summary> |
| 28 | + public static class QCAlgorithm |
| 29 | + { |
| 30 | + /// <summary> |
| 31 | + /// Returns a string message saying the time zone cannot be changed after the algorithm is running |
| 32 | + /// </summary> |
| 33 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 34 | + public static string SetTimeZoneAlreadyRunning() |
| 35 | + { |
| 36 | + return $"{AlgorithmPrefix()}.{FormatCode("SetTimeZone")}(): Cannot change time zone after algorithm running."; |
| 37 | + } |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// Returns a string message saying the benchmark cannot be changed after the algorithm is initialized |
| 41 | + /// </summary> |
| 42 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 43 | + public static string SetBenchmarkAlreadyInitialized() |
| 44 | + { |
| 45 | + return $"{AlgorithmPrefix()}.{FormatCode("SetBenchmark")}(): Cannot change Benchmark after algorithm initialized."; |
| 46 | + } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Returns a string message saying the account currency cannot be changed after the algorithm is initialized |
| 50 | + /// </summary> |
| 51 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 52 | + public static string SetAccountCurrencyAlreadyInitialized() |
| 53 | + { |
| 54 | + return $"{AlgorithmPrefix()}.{FormatCode("SetAccountCurrency")}(): Cannot change AccountCurrency after algorithm initialized."; |
| 55 | + } |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Returns a string message saying the cash cannot be changed after the algorithm is initialized |
| 59 | + /// </summary> |
| 60 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 61 | + public static string SetCashAlreadyInitialized() |
| 62 | + { |
| 63 | + return $"{AlgorithmPrefix()}.{FormatCode("SetCash")}(): Cannot change cash available after algorithm initialized."; |
| 64 | + } |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// Returns a string message saying the start date cannot be changed after the algorithm is initialized |
| 68 | + /// </summary> |
| 69 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 70 | + public static string SetStartDateAlreadyInitialized() |
| 71 | + { |
| 72 | + return $"{AlgorithmPrefix()}.{FormatCode("SetStartDate")}(): Cannot change start date after algorithm initialized."; |
| 73 | + } |
| 74 | + |
| 75 | + /// <summary> |
| 76 | + /// Returns a string message saying the end date cannot be changed after the algorithm is initialized |
| 77 | + /// </summary> |
| 78 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 79 | + public static string SetEndDateAlreadyInitialized() |
| 80 | + { |
| 81 | + return $"{AlgorithmPrefix()}.{FormatCode("SetEndDate")}(): Cannot change end date after algorithm initialized."; |
| 82 | + } |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Returns a string message saying SetWarmup cannot be used after the algorithm is initialized |
| 86 | + /// </summary> |
| 87 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 88 | + public static string SetWarmupAlreadyInitialized() |
| 89 | + { |
| 90 | + return $"{AlgorithmPrefix()}.{FormatCode("SetWarmup")}(): This method cannot be used after algorithm initialized"; |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + /// <summary> |
| 95 | + /// Provides user-facing messages for the <see cref="AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper"/> class |
| 96 | + /// and its consumers or related classes |
| 97 | + /// </summary> |
| 98 | + public static class AlgorithmPythonWrapper |
| 99 | + { |
| 100 | + /// <summary> |
| 101 | + /// Returns a string message saying OnMarginCall must return a non-empty list of SubmitOrderRequest |
| 102 | + /// </summary> |
| 103 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 104 | + public static string OnMarginCallMustReturnNonEmptyList() |
| 105 | + { |
| 106 | + return $"{FormatCode("OnMarginCall")} must return a non-empty list of SubmitOrderRequest"; |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | +} |
0 commit comments