/*
* 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 Newtonsoft.Json;
namespace QuantConnect.Packets
{
///
/// Specifies values used to control algorithm limits
///
public class Controls
{
///
/// The maximum number of minute symbols
///
[JsonProperty(PropertyName = "iMinuteLimit")]
public int MinuteLimit;
///
/// The maximum number of second symbols
///
[JsonProperty(PropertyName = "iSecondLimit")]
public int SecondLimit;
///
/// The maximum number of tick symbol
///
[JsonProperty(PropertyName = "iTickLimit")]
public int TickLimit;
///
/// Ram allocation for this backtest in MB
///
[JsonProperty(PropertyName = "iRamAllocation")]
public int RamAllocation;
///
/// The user backtesting log limit
///
[JsonProperty(PropertyName = "iBacktestLogLimit")]
public int BacktestLogLimit;
///
/// The daily log limit of a user
///
[JsonProperty(PropertyName = "iDailyLogLimit")]
public int DailyLogLimit;
///
/// The remaining log allowance for a user
///
[JsonProperty(PropertyName = "iRemainingLogAllowance")]
public int RemainingLogAllowance;
///
/// Maximimum number of insights we'll store and score in a single backtest
///
[JsonProperty(PropertyName = "iBacktestingMaxInsights")]
public int BacktestingMaxInsights;
///
/// Limits the amount of data points per chart series. Applies only for backtesting
///
[JsonProperty(PropertyName = "iMaximumDataPointsPerChartSeries")]
public int MaximumDataPointsPerChartSeries;
///
/// Initializes a new default instance of the class
///
public Controls()
{
MinuteLimit = 500;
SecondLimit = 100;
TickLimit = 30;
RamAllocation = 1024;
BacktestLogLimit = 10000;
DailyLogLimit = 3000000;
RemainingLogAllowance = 10000;
BacktestingMaxInsights = 10000;
MaximumDataPointsPerChartSeries = 4000;
}
///
/// Gets the maximum number of subscriptions for the specified resolution
///
public int GetLimit(Resolution resolution)
{
switch (resolution)
{
case Resolution.Tick:
return TickLimit;
case Resolution.Second:
return SecondLimit;
case Resolution.Minute:
case Resolution.Hour:
case Resolution.Daily:
default:
return MinuteLimit;
}
}
}
}