/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.Runtime.CompilerServices; namespace QuantConnect { /// /// Provides user-facing message construction methods and static messages for the namespace /// public static partial class Messages { /// /// Provides user-facing messages for the class and its consumers or related classes /// public static class QCAlgorithm { /// /// Returns a string message saying the time zone cannot be changed after the algorithm is running /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetTimeZoneAlreadyRunning() { return $"{AlgorithmPrefix()}.{FormatCode("SetTimeZone")}(): Cannot change time zone after algorithm running."; } /// /// Returns a string message saying the benchmark cannot be changed after the algorithm is initialized /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetBenchmarkAlreadyInitialized() { return $"{AlgorithmPrefix()}.{FormatCode("SetBenchmark")}(): Cannot change Benchmark after algorithm initialized."; } /// /// Returns a string message saying the account currency cannot be changed after the algorithm is initialized /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetAccountCurrencyAlreadyInitialized() { return $"{AlgorithmPrefix()}.{FormatCode("SetAccountCurrency")}(): Cannot change AccountCurrency after algorithm initialized."; } /// /// Returns a string message saying the cash cannot be changed after the algorithm is initialized /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetCashAlreadyInitialized() { return $"{AlgorithmPrefix()}.{FormatCode("SetCash")}(): Cannot change cash available after algorithm initialized."; } /// /// Returns a string message saying the start date cannot be changed after the algorithm is initialized /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetStartDateAlreadyInitialized() { return $"{AlgorithmPrefix()}.{FormatCode("SetStartDate")}(): Cannot change start date after algorithm initialized."; } /// /// Returns a string message saying the end date cannot be changed after the algorithm is initialized /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetEndDateAlreadyInitialized() { return $"{AlgorithmPrefix()}.{FormatCode("SetEndDate")}(): Cannot change end date after algorithm initialized."; } /// /// Returns a string message saying SetWarmup cannot be used after the algorithm is initialized /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string SetWarmupAlreadyInitialized() { return $"{AlgorithmPrefix()}.{FormatCode("SetWarmup")}(): This method cannot be used after algorithm initialized"; } /// /// Returns a string message saying the first argument to AddData must be a custom data class /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string AddDataInvalidPyObjectType(string repr) { return $"{AlgorithmPrefix()}.{FormatCode("AddData")}(): the first argument must be a custom data type (a Python class deriving from {FormatCode("PythonData")} or a CLR {FormatCode("BaseData")} type), but received {repr}. " + $"To subscribe to built-in asset classes use, for example, {FormatCode("AddEquity")} or {FormatCode("AddCrypto")}."; } } /// /// Provides user-facing messages for the class /// and its consumers or related classes /// public static class AlgorithmPythonWrapper { /// /// Returns a string message saying OnMarginCall must return a non-empty list of SubmitOrderRequest /// [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string OnMarginCallMustReturnNonEmptyList() { return $"{FormatCode("OnMarginCall")} must return a non-empty list of SubmitOrderRequest"; } } } }