chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:02:50 +08:00
commit 0fc60fdcb1
5008 changed files with 910633 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,87 @@
/*
* 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;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Definition of the FineFundamental class
/// </summary>
public partial class FineFundamental
{
/// <summary>
/// The end time of this data.
/// </summary>
[JsonIgnore]
public override DateTime EndTime
{
get { return Time + QuantConnect.Time.OneDay; }
set { Time = value - QuantConnect.Time.OneDay; }
}
/// <summary>
/// Price * Total SharesOutstanding.
/// The most current market cap for example, would be the most recent closing price x the most recent reported shares outstanding.
/// For ADR share classes, market cap is price * (ordinary shares outstanding / adr ratio).
/// </summary>
[JsonIgnore]
public long MarketCap => CompanyProfile.MarketCap;
/// <summary>
/// Return the URL string source of the file. This will be converted to a stream
/// </summary>
public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)
{
throw new InvalidOperationException();
}
/// <summary>
/// Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object
/// each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.
/// </summary>
public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
{
throw new InvalidOperationException();
}
/// <summary>
/// Clones this fine data instance
/// </summary>
/// <returns></returns>
public override BaseData Clone()
{
return new FineFundamental(Time, Symbol, _fundamentalInstanceProvider);
}
/// <summary>
/// This is a daily data set
/// </summary>
public override List<Resolution> SupportedResolutions()
{
return DailyResolution;
}
/// <summary>
/// This is a daily data set
/// </summary>
public override Resolution DefaultResolution()
{
return Resolution.Daily;
}
}
}
+140
View File
@@ -0,0 +1,140 @@
/*
* 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;
using System.IO;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Lean fundamental data class
/// </summary>
public class Fundamental : FineFundamental
{
/// <summary>
/// Gets the day's dollar volume for this symbol
/// </summary>
public override double DollarVolume => FundamentalService.Get<double>(Time, Symbol.ID, FundamentalProperty.DollarVolume);
/// <summary>
/// Gets the day's total volume
/// </summary>
public override long Volume => FundamentalService.Get<long>(Time, Symbol.ID, FundamentalProperty.Volume);
/// <summary>
/// Returns whether the symbol has fundamental data for the given date
/// </summary>
public override bool HasFundamentalData => FundamentalService.Get<bool>(Time, Symbol.ID, FundamentalProperty.HasFundamentalData);
/// <summary>
/// Gets the price factor for the given date
/// </summary>
public override decimal PriceFactor => FundamentalService.Get<decimal>(Time, Symbol.ID, FundamentalProperty.PriceFactor);
/// <summary>
/// Gets the split factor for the given date
/// </summary>
public override decimal SplitFactor => FundamentalService.Get<decimal>(Time, Symbol.ID, FundamentalProperty.SplitFactor);
/// <summary>
/// Gets the raw price
/// </summary>
public override decimal Value => FundamentalService.Get<decimal>(Time, Symbol.ID, FundamentalProperty.Value);
/// <summary>
/// Creates a new empty instance
/// </summary>
public Fundamental()
{
}
/// <summary>
/// Creates a new instance
/// </summary>
/// <param name="time">The current time</param>
/// <param name="symbol">The associated symbol</param>
public Fundamental(DateTime time, Symbol symbol)
: base(time, symbol)
{
}
/// <summary>
/// Creates a new instance
/// </summary>
/// <param name="time">The current time</param>
/// <param name="symbol">The associated symbol</param>
public static Fundamental ForDate(DateTime time, Symbol symbol)
{
// Important: set EndTime to time so that time is previous day midnight, if we just set time, EndTime would be NEXT day midnight.
// Note: data for T date is available on T+1 date, fundamental selection also handles this, see BaseDataCollectionSubscriptionEnumeratorFactory
return new Fundamental(time, symbol) { EndTime = time };
}
/// <summary>
/// Return the URL string source of the file. This will be converted to a stream
/// </summary>
public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)
{
var path = Path.Combine(Globals.DataFolder, "equity", config.Market, "fundamental", "coarse", $"{date:yyyyMMdd}.csv");
return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);
}
/// <summary>
/// Will read a new instance from the given line
/// </summary>
/// <param name="config">The associated requested configuration</param>
/// <param name="line">The line to parse</param>
/// <param name="date">The current time</param>
/// <param name="isLiveMode">True if live mode</param>
/// <returns>A new instance or null</returns>
public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
{
try
{
var csv = line.Split(',');
var sid = SecurityIdentifier.Parse(csv[0]);
// This use case/Reader implementation is only for history, where the user requests specific symbols only
// and because we use the same source file as the universe Fundamentals we need to filter out other symbols
if (sid == config.Symbol.ID)
{
return new Fundamental(date, new Symbol(sid, csv[1]));
}
}
catch
{
// pass
}
return null;
}
/// <summary>
/// Will clone the current instance
/// </summary>
/// <returns>The cloned instance</returns>
public override BaseData Clone()
{
return new Fundamental(Time, Symbol);
}
/// <summary>
/// Gets the default resolution for this data and security type
/// </summary>
public override Resolution DefaultResolution()
{
return Resolution.Daily;
}
}
}
@@ -0,0 +1,184 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Per symbol we will have a fundamental class provider so the instances can be reused
/// </summary>
public class FundamentalInstanceProvider
{
private static readonly Dictionary<SecurityIdentifier, FundamentalInstanceProvider> _cache = new();
private readonly FundamentalTimeProvider _timeProvider;
private readonly FinancialStatements _financialStatements;
private readonly OperationRatios _operationRatios;
private readonly SecurityReference _securityReference;
private readonly CompanyReference _companyReference;
private readonly CompanyProfile _companyProfile;
private readonly AssetClassification _assetClassification;
private readonly ValuationRatios _valuationRatios;
private readonly EarningRatios _earningRatios;
private readonly EarningReports _earningReports;
/// <summary>
/// Get's the fundamental instance provider for the requested symbol
/// </summary>
/// <param name="symbol">The requested symbol</param>
/// <returns>The unique instance provider</returns>
public static FundamentalInstanceProvider Get(Symbol symbol)
{
FundamentalInstanceProvider result = null;
lock (_cache)
{
_cache.TryGetValue(symbol.ID, out result);
}
if (result == null)
{
// we create the fundamental instance provider without holding the cache lock, this is because it uses the pygil
// Deadlock case: if the main thread has PyGil and wants to take lock on cache (security.Fundamentals use case) and the data
// stack thread takes the lock on the cache (creating new fundamentals) and next wants the pygil deadlock!
result = new FundamentalInstanceProvider(symbol);
lock (_cache)
{
_cache[symbol.ID] = result;
}
}
return result;
}
/// <summary>
/// Creates a new fundamental instance provider
/// </summary>
/// <param name="symbol">The target symbol</param>
private FundamentalInstanceProvider(Symbol symbol)
{
_timeProvider = new();
_financialStatements = new(_timeProvider, symbol.ID);
_operationRatios = new(_timeProvider, symbol.ID);
_securityReference = new(_timeProvider, symbol.ID);
_companyReference = new(_timeProvider, symbol.ID);
_companyProfile = new(_timeProvider, symbol.ID);
_assetClassification = new(_timeProvider, symbol.ID);
_valuationRatios = new(_timeProvider, symbol.ID);
_earningRatios = new(_timeProvider, symbol.ID);
_earningReports = new(_timeProvider, symbol.ID);
}
/// <summary>
/// Returns the ValuationRatios instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ValuationRatios GetValuationRatios(DateTime time)
{
_timeProvider.Time = time;
return _valuationRatios;
}
/// <summary>
/// Returns the EarningRatios instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public EarningRatios GetEarningRatios(DateTime time)
{
_timeProvider.Time = time;
return _earningRatios;
}
/// <summary>
/// Returns the EarningReports instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public EarningReports GetEarningReports(DateTime time)
{
_timeProvider.Time = time;
return _earningReports;
}
/// <summary>
/// Returns the OperationRatios instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public OperationRatios GetOperationRatios(DateTime time)
{
_timeProvider.Time = time;
return _operationRatios;
}
/// <summary>
/// Returns the FinancialStatements instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public FinancialStatements GetFinancialStatements(DateTime time)
{
_timeProvider.Time = time;
return _financialStatements;
}
/// <summary>
/// Returns the SecurityReference instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public SecurityReference GetSecurityReference(DateTime time)
{
_timeProvider.Time = time;
return _securityReference;
}
/// <summary>
/// Returns the CompanyReference instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public CompanyReference GetCompanyReference(DateTime time)
{
_timeProvider.Time = time;
return _companyReference;
}
/// <summary>
/// Returns the CompanyProfile instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public CompanyProfile GetCompanyProfile(DateTime time)
{
_timeProvider.Time = time;
return _companyProfile;
}
/// <summary>
/// Returns the AssetClassification instance
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AssetClassification GetAssetClassification(DateTime time)
{
_timeProvider.Time = time;
return _assetClassification;
}
private class FundamentalTimeProvider : ITimeProvider
{
public DateTime Time;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DateTime GetUtcNow() => Time;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,50 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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 Python.Runtime;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Simple base class shared by top layer fundamental properties which depend on a time provider
/// </summary>
public abstract class FundamentalTimeDependentProperty : ReusuableCLRObject
{
/// <summary>
/// The time provider instance to use
/// </summary>
protected ITimeProvider _timeProvider { get; }
/// <summary>
/// The SID instance to use
/// </summary>
protected SecurityIdentifier _securityIdentifier { get; }
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public FundamentalTimeDependentProperty(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)
{
_timeProvider = timeProvider;
_securityIdentifier = securityIdentifier;
}
/// <summary>
/// Clones this instance
/// </summary>
public abstract FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider);
}
}
@@ -0,0 +1,148 @@
/*
* 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;
using System.Collections.Generic;
using System.Threading;
using Python.Runtime;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Lean fundamentals universe data class
/// </summary>
[Obsolete("'Fundamentals' was renamed to 'FundamentalUniverse'")]
public class Fundamentals : FundamentalUniverse { }
/// <summary>
/// Lean fundamentals universe data class
/// </summary>
public class FundamentalUniverse : BaseDataCollection
{
private static int _universeCount;
private static readonly Fundamental _factory = new();
/// <summary>
/// Creates a new instance
/// </summary>
public FundamentalUniverse()
{
}
/// <summary>
/// Creates a new instance
/// </summary>
/// <param name="time">The current time</param>
/// <param name="symbol">The associated symbol</param>
public FundamentalUniverse(DateTime time, Symbol symbol) : base(time, symbol)
{
}
/// <summary>
/// Return the URL string source of the file. This will be converted to a stream
/// </summary>
public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)
{
var path = _factory.GetSource(config, date, isLiveMode).Source;
return new SubscriptionDataSource(path, SubscriptionTransportMedium.LocalFile, FileFormat.FoldingCollection);
}
/// <summary>
/// Will read a new instance from the given line
/// </summary>
/// <param name="config">The associated requested configuration</param>
/// <param name="line">The line to parse</param>
/// <param name="date">The current time</param>
/// <param name="isLiveMode">True if live mode</param>
/// <returns>A new instance or null</returns>
public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
{
try
{
var csv = line.Split(',');
var symbol = new Symbol(SecurityIdentifier.Parse(csv[0]), csv[1]);
return new Fundamental(date, symbol);
}
catch (Exception)
{
return null;
}
}
/// <summary>
/// Will clone the current instance
/// </summary>
/// <returns>The cloned instance</returns>
public override BaseData Clone()
{
return new FundamentalUniverse(Time, Symbol) { Data = Data, EndTime = EndTime };
}
/// <summary>
/// Gets the default resolution for this data and security type
/// </summary>
/// <remarks>This is a method and not a property so that python
/// custom data types can override it</remarks>
public override Resolution DefaultResolution()
{
return Resolution.Daily;
}
/// <summary>
/// Creates the universe symbol for the target market
/// </summary>
/// <returns>The universe symbol to use</returns>
public override Symbol UniverseSymbol(string market = null)
{
market ??= QuantConnect.Market.USA;
var ticker = $"{GetType().Name}-{market}-{Interlocked.Increment(ref _universeCount):D10}-{Guid.NewGuid()}";
return Symbol.Create(ticker, SecurityType.Equity, market, baseDataType: GetType());
}
/// <summary>
/// Creates a new fundamental universe for the USA market
/// </summary>
/// <param name="selector">The selector function</param>
/// <param name="universeSettings">The universe settings to use, will default to algorithms if not provided</param>
/// <returns>A configured new universe instance</returns>
public static FundamentalUniverseFactory USA(Func<IEnumerable<Fundamental>, IEnumerable<Symbol>> selector, UniverseSettings universeSettings = null)
{
return new FundamentalUniverseFactory(QuantConnect.Market.USA, universeSettings, selector);
}
/// <summary>
/// Creates a new fundamental universe for the USA market
/// </summary>
/// <param name="selector">The selector function</param>
/// <param name="universeSettings">The universe settings to use, will default to algorithms if not provided</param>
/// <returns>A configured new universe instance</returns>
public static FundamentalUniverseFactory USA(PyObject selector, UniverseSettings universeSettings = null)
{
return new FundamentalUniverseFactory(QuantConnect.Market.USA, universeSettings, selector);
}
/// <summary>
/// Creates a new fundamental universe for the USA market
/// </summary>
/// <param name="selector">The selector function</param>
/// <param name="universeSettings">The universe settings to use, will default to algorithms if not provided</param>
/// <returns>A configured new universe instance</returns>
public static FundamentalUniverseFactory USA(Func<IEnumerable<Fundamental>, object> selector, UniverseSettings universeSettings = null)
{
return new FundamentalUniverseFactory(QuantConnect.Market.USA, universeSettings, selector);
}
}
}
@@ -0,0 +1,101 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// This is the simple average of the company's ROIC over the last 5 years. Return on invested capital is calculated by taking net operating profit after taxes and dividends and dividing by the total amount of capital invested and expressing the result as a percentage.
/// </summary>
public class AVG5YrsROIC : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "FiveYears";
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AVG5YrsROIC_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AVG5YrsROIC_FiveYears));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AVG5YrsROIC_FiveYears);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_AVG5YrsROIC_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AVG5YrsROIC()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AVG5YrsROIC(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Any money that a company owes its suppliers for goods and services purchased on credit and is expected to pay within the next year or operating cycle.
/// </summary>
public class AccountsPayableBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsPayable_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccountsPayable_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccountsPayableBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccountsPayableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Accounts owed to a company by customers within a year as a result of exchanging goods or services on credit.
/// </summary>
public class AccountsReceivableBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccountsReceivable_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccountsReceivable_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccountsReceivableBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccountsReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// This account shows the amount of unpaid interest accrued to the date of purchase and included in the purchase price of securities purchased between interest dates.
/// </summary>
public class AccruedInterestReceivableBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInterestReceivable_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccruedInterestReceivable_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccruedInterestReceivableBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccruedInterestReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Interest, dividends, rents, ancillary and other revenues earned but not yet received by the entity on its investments.
/// </summary>
public class AccruedInvestmentIncomeBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_ThreeMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_SixMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedInvestmentIncome_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccruedInvestmentIncome_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccruedInvestmentIncomeBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccruedInvestmentIncomeBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Liabilities which have occurred, but have not been paid or logged under accounts payable during an accounting PeriodAsByte. In other words, obligations for goods and services provided to a company for which invoices have not yet been received; on a Non- Differentiated Balance Sheet.
/// </summary>
public class AccruedLiabilitiesTotalBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccruedLiabilitiesTotal_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccruedLiabilitiesTotalBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccruedLiabilitiesTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Sum of accrued liabilities and deferred income (amount received in advance but the services are not provided in respect of amount).
/// </summary>
public class AccruedandDeferredIncomeBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncome_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccruedandDeferredIncome_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccruedandDeferredIncomeBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccruedandDeferredIncomeBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Sum of Accrued Liabilities and Deferred Income (amount received in advance but the services are not provided in respect of amount) due within 1 year.
/// </summary>
public class AccruedandDeferredIncomeCurrentBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccruedandDeferredIncomeCurrent_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccruedandDeferredIncomeCurrentBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccruedandDeferredIncomeCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Sum of Accrued Liabilities and Deferred Income (amount received in advance but the services are not provided in respect of amount) due after 1 year.
/// </summary>
public class AccruedandDeferredIncomeNonCurrentBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccruedandDeferredIncomeNonCurrent_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccruedandDeferredIncomeNonCurrentBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccruedandDeferredIncomeNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The cumulative amount of wear and tear or obsolescence charged against the fixed assets of a company.
/// </summary>
public class AccumulatedDepreciationBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AccumulatedDepreciation_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AccumulatedDepreciation_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AccumulatedDepreciationBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AccumulatedDepreciationBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Excess of issue price over par or stated value of the entity's capital stock and amounts received from other transactions involving the entity's stock or stockholders. Includes adjustments to additional paid in capital. There are two major categories of additional paid in capital: 1) Paid in capital in excess of par/stated value, which is the difference between the actual issue price of the shares and the shares' par/stated value. 2) Paid in capital from other transactions which includes treasury stock, retirement of stock, stock dividends recorded at market, lapse of stock purchase warrants, conversion of convertible bonds in excess of the par value of the stock, and any other additional capital from the company's own stock transactions.
/// </summary>
public class AdditionalPaidInCapitalBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdditionalPaidInCapital_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AdditionalPaidInCapital_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AdditionalPaidInCapitalBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AdditionalPaidInCapitalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// This item is typically available for bank industry. It's the amount of borrowings as of the balance sheet date from the Federal Home Loan Bank, which are primarily used to cover shortages in the required reserve balance and liquidity shortages.
/// </summary>
public class AdvanceFromFederalHomeLoanBanksBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AdvanceFromFederalHomeLoanBanks_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AdvanceFromFederalHomeLoanBanksBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AdvanceFromFederalHomeLoanBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Borrowings from the central bank, which are primarily used to cover shortages in the required reserve balance and liquidity shortages.
/// </summary>
public class AdvancesfromCentralBanksBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AdvancesfromCentralBanks_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AdvancesfromCentralBanksBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AdvancesfromCentralBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash paid to tax authorities in operating cash flow, using the direct method
/// </summary>
public class AllTaxesPaidCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_OneMonth);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AllTaxesPaid_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_AllTaxesPaid_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AllTaxesPaidCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AllTaxesPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// An Allowance for Doubtful Accounts measures receivables recorded but not expected to be collected.
/// </summary>
public class AllowanceForDoubtfulAccountsReceivableBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AllowanceForDoubtfulAccountsReceivable_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AllowanceForDoubtfulAccountsReceivableBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AllowanceForDoubtfulAccountsReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// A contra account sets aside as an allowance for bad loans (e.g. customer defaults).
/// </summary>
public class AllowanceForLoansAndLeaseLossesBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AllowanceForLoansAndLeaseLosses_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AllowanceForLoansAndLeaseLossesBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AllowanceForLoansAndLeaseLossesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// This item is typically available for bank industry. It represents a provision relating to a written agreement to receive money with the terms of the note (at a specified future date(s) within one year from the reporting date (or the normal operating cycle, whichever is longer), consisting of principal as well as any accrued interest) for the portion that is expected to be uncollectible.
/// </summary>
public class AllowanceForNotesReceivableBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AllowanceForNotesReceivable_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AllowanceForNotesReceivableBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AllowanceForNotesReceivableBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The systematic and rational apportionment of the acquisition cost of intangible operational assets to future periods in which the benefits contribute to revenue. This field is to include Amortization and any variation where Amortization is the first account listed in the line item, excluding Amortization of Intangibles.
/// </summary>
public class AmortizationCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_Amortization_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_Amortization_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The non-cash expense recognized on intangible assets over the benefit period of the asset.
/// </summary>
public class AmortizationIncomeStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_Amortization_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_IncomeStatement_Amortization_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationIncomeStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The component of interest expense representing the non-cash expenses charged against earnings in the period to allocate debt discount and premium, and the costs to issue debt and obtain financing over the related debt instruments. This item is usually only available for bank industry.
/// </summary>
public class AmortizationOfFinancingCostsAndDiscountsCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_AmortizationOfFinancingCostsAndDiscounts_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationOfFinancingCostsAndDiscountsCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationOfFinancingCostsAndDiscountsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The aggregate expense charged against earnings to allocate the cost of intangible assets (nonphysical assets not used in production) in a systematic and rational manner to the periods expected to benefit from such assets.
/// </summary>
public class AmortizationOfIntangiblesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_AmortizationOfIntangibles_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationOfIntangiblesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationOfIntangiblesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The aggregate expense charged against earnings to allocate the cost of intangible assets (nonphysical assets not used in production) in a systematic and rational manner to the periods expected to benefit from such assets.
/// </summary>
public class AmortizationOfIntangiblesIncomeStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationOfIntangibles_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_IncomeStatement_AmortizationOfIntangibles_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationOfIntangiblesIncomeStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationOfIntangiblesIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Represents amortization of the allocation of a lump sum amount to different time periods, particularly for securities, debt, loans, and other forms of financing. Does not include amortization, amortization of capital expenditure and intangible assets.
/// </summary>
public class AmortizationOfSecuritiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AmortizationOfSecurities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_AmortizationOfSecurities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationOfSecuritiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationOfSecuritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The current period expense charged against earnings on intangible asset over its useful life. It is a supplemental value which would be reported outside consolidated statements.
/// </summary>
public class AmortizationSupplementalIncomeStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AmortizationSupplemental_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_IncomeStatement_AmortizationSupplemental_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AmortizationSupplementalIncomeStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AmortizationSupplementalIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,200 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Definition of the AssetClassification class
/// </summary>
public class AssetClassification : FundamentalTimeDependentProperty
{
/// <summary>
/// The purpose of the Stock Types is to group companies according to the underlying fundamentals of their business. They answer the question: If I buy this stock, what kind of company am I buying? Unlike the style box, the emphasis with the Stock Types is on income statement, balance sheet, and cash-flow data-not price data or valuation multiples. We focus on the company, not the stock. Morningstar calculates this figure in-house on a monthly basis.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3000
/// </remarks>
[JsonProperty("3000")]
public int StockType => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_StockType);
/// <summary>
/// The Morningstar Equity Style Box is a grid that provides a graphical representation of the investment style of stocks and portfolios. It classifies securities according to market capitalization (the vertical axis) and value-growth scores (the horizontal axis) and allows us to provide analysis on a 5-by-5 Style Box as well as providing the traditional style box assignment, which is the basis for the Morningstar Category. Two of the style categories, value and growth, are common to both stocks and portfolios. However, for stocks, the central column of the style box represents the core style (those stocks for which neither value nor growth characteristics dominate); for portfolios, it represents the blend style.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3001
/// </remarks>
[JsonProperty("3001")]
public int StyleBox => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_StyleBox);
/// <summary>
/// The growth grade is based on the trend in revenue per share using data from the past five years. For the purpose of calculating revenue per share we use the past five years' revenue figures and corresponding year-end fully diluted shares outstanding; if year- end fully diluted shares outstanding is not available, we calculate this figure by dividing the company's reported net income applicable to common shareholders by the reported fully diluted earnings per share. A company must have a minimum of four consecutive years of positive and non-zero revenue, including the latest fiscal year, to qualify for a grade. In calculating the revenue per share growth rate, we calculate the slope of the regression line of historical revenue per share. We then divide the slope of the regression line by the arithmetic average of historical revenue per share figures. The result of the regression is a normalized historical increase or decrease in the rate of growth for sales per share. We then calculate a z-score by subtracting the universe mean revenue growth from the company's revenue growth, and dividing by the standard deviation of the universe's growth rates. Stocks are sorted based on the z-score of their revenue per share growth rate calculated above, from the most negative z-score to the most positive z-score. Stocks are then ranked based on their z-score from 1 to the total number of qualified stocks. We assign grades based on this ranking. Stocks are assigned A, B, C, D, or F. Morningstar calculates this figure in-house on a monthly basis.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3002
/// </remarks>
[JsonProperty("3002")]
public string GrowthGrade => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_GrowthGrade);
/// <summary>
/// Instead of using accounting-based ratios to formulate a measure to reflect the financial health of a firm, we use structural or contingent claim models. Structural models take advantage of both market information and accounting financial information. The firm's equity in such models is viewed as a call option on the value of the firm's assets. If the value of the assets is not sufficient to cover the firm's liabilities (the strike price), default is expected to occur, and the call option expires worthless and the firm is turned over to its creditors. To estimate a distance to default, the value of the firm's liabilities is obtained from the firm's latest balance sheet and incorporated into the model. We then rank the calculated distance to default and award 10% of the universe A's, 20% B's, 40% C's, 20% D's, and 10% F's. Morningstar calculates this figure in-house on a daily basis.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3003
/// </remarks>
[JsonProperty("3003")]
public string FinancialHealthGrade => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_FinancialHealthGrade);
/// <summary>
/// The profitability grade for all qualified companies in Morningstar's stock universe is based on valuation of return on shareholders' equity (ROE) using data from the past five years. Morningstar's universe of stocks is first filtered for adequacy of historical ROE figures. Companies with less than four years of consecutive ROE figures including the ROE figure for the latest fiscal year are tossed from calculations and are assigned "--" for the profitability grade. For the remaining qualified universe of stocks the profitability grade is based on the valuation of the following three components, which are assigned different weights; the historical growth rate of ROE, the average level of historical ROE, the level of ROE in the latest fiscal year of the company. Stocks are assigned A, B, C, D, or F. Morningstar calculates this figure in-house on a monthly basis.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3004
/// </remarks>
[JsonProperty("3004")]
public string ProfitabilityGrade => FundamentalService.Get<string>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_ProfitabilityGrade);
/// <summary>
/// Equities are mapped into one of 148 industries, the one which most accurately reflects the underlying business of that company. This mapping is based on publicly available information about each company and uses annual reports, Form 10-Ks and Morningstar Equity Analyst input as its primary source. Other secondary sources of information may include company web sites, sell-side research (if available) and trade publications. By and large, equities are mapped into the industries that best reflect each company's largest source of revenue and income. If the company has more than three sources of revenue and income and there is no clear dominant revenue and income stream, the company is assigned to the Conglomerates industry. Based on Morningstar analyst research or other third party information, Morningstar may change industry assignments to more accurately reflect the changing businesses of companies.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3005
/// </remarks>
[JsonProperty("3005")]
public int MorningstarIndustryCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarIndustryCode);
/// <summary>
/// Industries are mapped into 69 industry groups based on their common operational characteristics. If a particular industry has unique operating characteristics-or simply lacks commonality with other industries-it would map into its own group. However, any industry group containing just one single industry does not necessarily imply that that industry is dominant or otherwise important. The assignment simply reflects the lack of a sufficient amount of shared traits among industries. See appendix for mappings.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3006
/// </remarks>
[JsonProperty("3006")]
public int MorningstarIndustryGroupCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarIndustryGroupCode);
/// <summary>
/// Industry groups are consolidated into 11 sectors. See appendix for mappings.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3007
/// </remarks>
[JsonProperty("3007")]
public int MorningstarSectorCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarSectorCode);
/// <summary>
/// Sectors are consolidated into three major economic spheres or Super Sectors: Cyclical, Defensive and Sensitive. See appendix for mappings.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3008
/// </remarks>
[JsonProperty("3008")]
public int MorningstarEconomySphereCode => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_MorningstarEconomySphereCode);
/// <summary>
/// Standard Industrial Classification System (SIC) is a system for classifying a business according to economic activity. See separate reference document for a list of Sic Codes/Mappings.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3009
/// </remarks>
[JsonProperty("3009")]
public int SIC => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_SIC);
/// <summary>
/// An acronym for North American Industry Classification System, it is a 6 digit numerical classification assigned to individual companies. Developed jointly by the U.S., Canada, and Mexico to provide new comparability in statistics about business activity across North America. It is intended to replace the U.S. Standard Industrial Classification (SIC) system. See separate reference document for a list of NAICS Codes/Mappings.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3010
/// </remarks>
[JsonProperty("3010")]
public int NAICS => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_NAICS);
/// <summary>
/// The scores for a stock's value and growth characteristics determine its horizontal placement. The Value-Growth Score is a reflection of the aggregate expectations of market participants for the future growth and required rate of return for a stock. We infer these expectations from the relation between current market prices and future growth and cost of capital expectations under the assumption of rational market participants and a simple model of stock value.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3011
/// </remarks>
[JsonProperty("3011")]
public double StyleScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_StyleScore);
/// <summary>
/// Rather than a fixed number of large cap or small cap stocks, Morningstar uses a flexible system that isn't adversely affected by overall movements in the market. The Morningstar stock universe represents approximately 99% of the U.S. market for actively traded stocks. Giant-cap stocks are defined as the group that accounts for the top 40% of the capitalization of the Morningstar domestic stock universe; large-cap stocks represent the next 30%; mid-cap stocks represent the next 20%; small-cap stocks represent the next 7%; and micro-cap stocks represent the remaining 3%. Each stock is given a Size Score that ranges from -100 (very micro) to 400 (very giant). When classifying stocks to a Style Box, giant is included in large and micro is included in small.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3012
/// </remarks>
[JsonProperty("3012")]
public double SizeScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_SizeScore);
/// <summary>
/// A high overall growth score indicates that a stock's per-share earnings, book value, revenues, and cash flow are expected to grow quickly relative to other stocks in the same scoring group. A weak growth orientation does not necessarily mean that a stock has a strong value orientation.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3013
/// </remarks>
[JsonProperty("3013")]
public double GrowthScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_GrowthScore);
/// <summary>
/// A high value score indicates that a stock's price is relatively low, given the anticipated per-sharing earnings, book value, revenues, cash flow, and dividends that the stock provides to investors. A high price relative to these measures indicates that a stock's value orientation is weak, but it does not necessarily mean that the stock is growth-oriented.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3014
/// </remarks>
[JsonProperty("3014")]
public double ValueScore => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_ValueScore);
/// <summary>
/// NACE is a European standard classification of economic activities maintained by Eurostat.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3015
/// </remarks>
[JsonProperty("3015")]
public double NACE => FundamentalService.Get<double>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_NACE);
/// <summary>
/// Similar to NAICS (data point 3010, above), this is specifically for Canadian classifications. An acronym for North American Industry Classification System, it is a 6 digit numerical classification assigned to individual companies. Developed jointly by the U.S., Canada, and Mexico to provide new comparability in statistics about business activity across North America. It is intended to replace the U.S. Standard Industrial Classification (SIC) system. See separate reference document for a list of NAICS Codes/Mappings. The initial SIC and NAICS listed is the Primary based on revenue generation; followed by Secondary SIC and NAICS when applicable. Both SIC and NAICS are manually collected and assigned.
/// </summary>
/// <remarks>
/// Morningstar DataId: 3016
/// </remarks>
[JsonProperty("3016")]
public int CANNAICS => FundamentalService.Get<int>(_timeProvider.GetUtcNow(), _securityIdentifier, FundamentalProperty.AssetClassification_CANNAICS);
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetClassification(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier)
: base(timeProvider, securityIdentifier)
{
}
/// <summary>
/// Clones this instance
/// </summary>
public override FundamentalTimeDependentProperty Clone(ITimeProvider timeProvider)
{
return new AssetClassification(timeProvider, _securityIdentifier);
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The charge against earnings resulting from the aggregate write down of all assets from their carrying value to their fair value.
/// </summary>
public class AssetImpairmentChargeCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_AssetImpairmentCharge_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_AssetImpairmentCharge_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetImpairmentChargeCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetImpairmentChargeCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// This item is typically available for bank industry. It's a part of long-lived assets, which has been decided for sale in the future.
/// </summary>
public class AssetsHeldForSaleBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSale_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AssetsHeldForSale_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetsHeldForSaleBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetsHeldForSaleBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Short term assets set apart for sale to liquidate in the future and are measured at the lower of carrying amount and fair value less costs to sell.
/// </summary>
public class AssetsHeldForSaleCurrentBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AssetsHeldForSaleCurrent_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetsHeldForSaleCurrentBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetsHeldForSaleCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Long term assets set apart for sale to liquidate in the future and are measured at the lower of carrying amount and fair value less costs to sell.
/// </summary>
public class AssetsHeldForSaleNonCurrentBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AssetsHeldForSaleNonCurrent_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetsHeldForSaleNonCurrentBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetsHeldForSaleNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// A portion of a company's business that has been disposed of or sold.
/// </summary>
public class AssetsOfDiscontinuedOperationsBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AssetsOfDiscontinuedOperations_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetsOfDiscontinuedOperationsBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetsOfDiscontinuedOperationsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Total value collateral assets pledged to the bank that can be sold or used as collateral for other loans.
/// </summary>
public class AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotal_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Revenue / Average Total Assets
/// </summary>
public class AssetsTurnover : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_OneYear);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_SixMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_AssetsTurnover_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_AssetsTurnover_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AssetsTurnover()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AssetsTurnover(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Auditor opinion code will be one of the following for each annual period: Code Meaning UQ Unqualified Opinion UE Unqualified Opinion with Explanation QM Qualified - Due to change in accounting method QL Qualified - Due to litigation OT Qualified Opinion - Other AO Adverse Opinion DS Disclaim an opinion UA Unaudited
/// </summary>
public class AuditorReportStatus : MultiPeriodField<string>
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public string OneMonth => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public string TwoMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public string ThreeMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public string SixMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public string NineMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public string TwelveMonths => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(string), FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override string Value
{
get
{
var defaultValue = FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_AuditorReportStatus_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(string), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, string> GetPeriodValues()
{
var result = new Dictionary<string, string>();
foreach (var kvp in new[] { new Tuple<string, string>("1M", OneMonth), new Tuple<string, string>("2M", TwoMonths), new Tuple<string, string>("3M", ThreeMonths), new Tuple<string, string>("6M", SixMonths), new Tuple<string, string>("9M", NineMonths), new Tuple<string, string>("12M", TwelveMonths) })
{
if (!BaseFundamentalDataProvider.IsNone(typeof(string), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override string GetPeriodValue(string period) => FundamentalService.Get<string>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_AuditorReportStatus_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AuditorReportStatus()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AuditorReportStatus(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// For an unclassified balance sheet, this item represents equity securities categorized neither as held-to-maturity nor trading. Equity securities represent ownership interests or the right to acquire ownership interests in corporations and other legal entities which ownership interest is represented by shares of common or preferred stock (which is not mandatory redeemable or redeemable at the option of the holder), convertible securities, stock rights, or stock warrants. This category includes preferred stocks, available- for-sale and common stock, available-for-sale.
/// </summary>
public class AvailableForSaleSecuritiesBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_AvailableForSaleSecurities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_AvailableForSaleSecurities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AvailableForSaleSecuritiesBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AvailableForSaleSecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Adjustments to reported net income to calculate Diluted EPS, by assuming that all convertible instruments are converted to Common Equity. The adjustments usually include the interest expense of debentures when assumed converted and preferred dividends of convertible preferred stock when assumed converted.
/// </summary>
public class AverageDilutionEarningsIncomeStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_IncomeStatement_AverageDilutionEarnings_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_IncomeStatement_AverageDilutionEarnings_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public AverageDilutionEarningsIncomeStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public AverageDilutionEarningsIncomeStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Filing date of the Balance Sheet
/// </summary>
public class BalanceSheetFileDate : MultiPeriodField<DateTime>
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_OneMonth);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override DateTime Value
{
get
{
var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BSFileDate_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()
{
var result = new Dictionary<string, DateTime>();
foreach (var kvp in new[] { new Tuple<string, DateTime>("1M", OneMonth), new Tuple<string, DateTime>("3M", ThreeMonths), new Tuple<string, DateTime>("12M", TwelveMonths) })
{
if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BSFileDate_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BalanceSheetFileDate()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BalanceSheetFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// All indebtedness for borrowed money or the deferred purchase price of property or services, including without limitation reimbursement and other obligations with respect to surety bonds and letters of credit, all obligations evidenced by notes, bonds debentures or similar instruments, all capital lease obligations and all contingent obligations.
/// </summary>
public class BankIndebtednessBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankIndebtedness_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BankIndebtedness_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BankIndebtednessBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BankIndebtednessBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// A debt financing obligation issued by a bank or similar financial institution to a company, that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time within the next 12 months or operating cycle.
/// </summary>
public class BankLoansCurrentBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansCurrent_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BankLoansCurrent_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BankLoansCurrentBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BankLoansCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// A debt financing obligation issued by a bank or similar financial institution to a company, that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time beyond the current accounting PeriodAsByte.
/// </summary>
public class BankLoansNonCurrentBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansNonCurrent_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BankLoansNonCurrent_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BankLoansNonCurrentBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BankLoansNonCurrentBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Total debt financing obligation issued by a bank or similar financial institution to a company that entitles the lender or holder of the instrument to interest payments and the repayment of principal at a specified time; in a Non-Differentiated Balance Sheet.
/// </summary>
public class BankLoansTotalBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankLoansTotal_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BankLoansTotal_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BankLoansTotalBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BankLoansTotalBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The carrying amount of a life insurance policy on an officer, executive or employee for which the reporting entity (a bank) is entitled to proceeds from the policy upon death of the insured or surrender of the insurance policy.
/// </summary>
public class BankOwnedLifeInsuranceBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BankOwnedLifeInsurance_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BankOwnedLifeInsuranceBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BankOwnedLifeInsuranceBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Basic EPS from the Cumulative Effect of Accounting Change is the earnings attributable to the accounting change (during the reporting period) divided by the weighted average number of common shares outstanding.
/// </summary>
public class BasicAccountingChange : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAccountingChange_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicAccountingChange_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicAccountingChange()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicAccountingChange(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The shares outstanding used to calculate Basic EPS, which is the weighted average common share outstanding through the whole accounting PeriodAsByte. Note: If Basic Average Shares are not presented by the firm in the Income Statement, this data point will be null.
/// </summary>
public class BasicAverageShares : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicAverageShares_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicAverageShares_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicAverageShares()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicAverageShares(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Basic EPS from Continuing Operations is the earnings from continuing operations reported by the company divided by the weighted average number of common shares outstanding.
/// </summary>
public class BasicContinuousOperations : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicContinuousOperations_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicContinuousOperations_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicContinuousOperations()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicContinuousOperations(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Basic EPS from Discontinued Operations is the earnings from discontinued operations reported by the company divided by the weighted average number of common shares outstanding. This only includes gain or loss from discontinued operations.
/// </summary>
public class BasicDiscontinuousOperations : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicDiscontinuousOperations_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicDiscontinuousOperations_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicDiscontinuousOperations()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicDiscontinuousOperations(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Basic EPS is the bottom line net income divided by the weighted average number of common shares outstanding.
/// </summary>
public class BasicEPS : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPS_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicEPS_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicEPS()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicEPS(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Basic EPS from the Other Gains/Losses is the earnings attributable to the other gains/losses (during the reporting period) divided by the weighted average number of common shares outstanding.
/// </summary>
public class BasicEPSOtherGainsLosses : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicEPSOtherGainsLosses_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicEPSOtherGainsLosses_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicEPSOtherGainsLosses()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicEPSOtherGainsLosses(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Basic EPS from the Extraordinary Gains/Losses is the earnings attributable to the gains or losses (during the reporting period) from extraordinary items divided by the weighted average number of common shares outstanding.
/// </summary>
public class BasicExtraordinary : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningReports_BasicExtraordinary_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningReports_BasicExtraordinary_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BasicExtraordinary()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BasicExtraordinary(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The cash and equivalents balance at the beginning of the accounting period, as indicated on the Cash Flow statement.
/// </summary>
public class BeginningCashPositionCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_BeginningCashPosition_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_BeginningCashPosition_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BeginningCashPositionCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BeginningCashPositionCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Biological assets include plants and animals.
/// </summary>
public class BiologicalAssetsBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_ThreeMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BiologicalAssets_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BiologicalAssets_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BiologicalAssetsBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BiologicalAssetsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The growth in the company's book value per share on a percentage basis. Morningstar calculates the growth percentage based on the common shareholder's equity reported in the Balance Sheet divided by the diluted shares outstanding within the company filings or reports.
/// </summary>
public class BookValuePerShareGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_ThreeMonths);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.EarningRatios_BookValuePerShareGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"EarningRatios_BookValuePerShareGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BookValuePerShareGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BookValuePerShareGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Fixed assets that specifically deal with the facilities a company owns. Include the improvements associated with buildings.
/// </summary>
public class BuildingsAndImprovementsBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_BuildingsAndImprovements_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_BuildingsAndImprovements_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public BuildingsAndImprovementsBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public BuildingsAndImprovementsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The growth in the company's cash flow from operations on a percentage basis. Morningstar calculates the growth percentage based on the underlying cash flow from operations data reported in the Cash Flow Statement within the company filings or reports.
/// </summary>
public class CFOGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CFOGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CFOGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CFOGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CFOGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The growth in the company's capital expenditures on a percentage basis. Morningstar calculates the growth percentage based on the capital expenditures reported in the Cash Flow Statement within the company filings or reports.
/// </summary>
public class CapExGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CapExGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapExGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapExGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Capital expenditure, capitalized software development cost, maintenance capital expenditure, etc. as reported by the company.
/// </summary>
public class CapExReportedCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapExReported_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CapExReported_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapExReportedCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapExReportedCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,101 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Capital Expenditure / Revenue
/// </summary>
public class CapExSalesRatio : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExSalesRatio_OneYear);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExSalesRatio_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapExSalesRatio_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CapExSalesRatio_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapExSalesRatio()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapExSalesRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// This is the compound annual growth rate of the company's capital spending over the last 5 years. Capital Spending is the sum of the Capital Expenditure items found in the Statement of Cash Flows.
/// </summary>
public class CapitalExpenditureAnnual5YrGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpenditureAnnual5YrGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CapitalExpenditureAnnual5YrGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapitalExpenditureAnnual5YrGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapitalExpenditureAnnual5YrGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Funds used by a company to acquire or upgrade physical assets such as property, industrial buildings or equipment. This type of outlay is made by companies to maintain or increase the scope of their operations. Capital expenditures are generally depreciated or depleted over their useful life, as distinguished from repairs, which are subtracted from the income of the current year.
/// </summary>
public class CapitalExpenditureCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CapitalExpenditure_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CapitalExpenditure_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapitalExpenditureCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapitalExpenditureCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,101 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Measures the amount a company is investing in its business relative to EBITDA generated in a given PeriodAsByte.
/// </summary>
public class CapitalExpendituretoEBITDA : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpendituretoEBITDA_OneYear);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpendituretoEBITDA_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CapitalExpendituretoEBITDA_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CapitalExpendituretoEBITDA_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapitalExpendituretoEBITDA()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapitalExpendituretoEBITDA(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Current Portion of Capital Lease Obligation plus Long Term Portion of Capital Lease Obligation.
/// </summary>
public class CapitalLeaseObligationsBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalLeaseObligations_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CapitalLeaseObligations_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapitalLeaseObligationsBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapitalLeaseObligationsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The total amount of stock authorized for issue by a corporation, including common and preferred stock.
/// </summary>
public class CapitalStockBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CapitalStock_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CapitalStock_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CapitalStockBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CapitalStockBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,101 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash outlay for cash advances and loans made to other parties.
/// </summary>
public class CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashAdvancesandLoansMadetoOtherParties_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Includes unrestricted cash on hand, money market instruments and other debt securities which can be converted to cash immediately.
/// </summary>
public class CashAndCashEquivalentsBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndCashEquivalents_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CashAndCashEquivalents_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashAndCashEquivalentsBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashAndCashEquivalentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Includes cash on hand (currency and coin), cash items in process of collection, non-interest bearing deposits due from other financial institutions (including corporate credit unions), and balances with the Federal Reserve Banks, Federal Home Loan Banks and central banks.
/// </summary>
public class CashAndDueFromBanksBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashAndDueFromBanks_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CashAndDueFromBanks_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashAndDueFromBanksBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashAndDueFromBanksBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash includes currency on hand as well as demand deposits with banks or financial institutions. It also includes other kinds of accounts that have the general characteristics of demand deposits in that the customer may deposit additional funds at any time and also effectively may withdraw funds at any time without prior notice or penalty.
/// </summary>
public class CashBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_Cash_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_Cash_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The aggregate amount of cash, cash equivalents, and federal funds sold.
/// </summary>
public class CashCashEquivalentsAndFederalFundsSoldBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CashCashEquivalentsAndFederalFundsSold_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashCashEquivalentsAndFederalFundsSoldBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashCashEquivalentsAndFederalFundsSoldBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The aggregate amount of cash, cash equivalents, and marketable securities.
/// </summary>
public class CashCashEquivalentsAndMarketableSecuritiesBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CashCashEquivalentsAndMarketableSecurities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashCashEquivalentsAndMarketableSecuritiesBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashCashEquivalentsAndMarketableSecuritiesBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Days In Inventory + Days In Sales - Days In Payment
/// </summary>
public class CashConversionCycle : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_OneYear);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_SixMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashConversionCycle_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CashConversionCycle_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashConversionCycle()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashConversionCycle(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash Distribution of earnings to Minority Stockholders.
/// </summary>
public class CashDividendsForMinoritiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsForMinorities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashDividendsForMinorities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashDividendsForMinoritiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashDividendsForMinoritiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Payments for the cash dividends declared by an entity to shareholders during the PeriodAsByte. This element includes paid and unpaid dividends declared during the period for both common and preferred stock.
/// </summary>
public class CashDividendsPaidCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashDividendsPaid_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashDividendsPaid_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashDividendsPaidCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashDividendsPaidCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash equivalents, excluding items classified as marketable securities, include short-term, highly liquid investments that are both readily convertible to known amounts of cash, and so near their maturity that they present insignificant risk of changes in value because of changes in interest rates. Generally, only investments with original maturities of three months or less qualify under this definition. Original maturity means original maturity to the entity holding the investment. For example, both a three-month US Treasury bill and a three-year Treasury note purchased three months from maturity qualify as cash equivalents. However, a Treasury note purchased three years ago does not become a cash equivalent when its remaining maturity is three months.
/// </summary>
public class CashEquivalentsBalanceSheet : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_BalanceSheet_CashEquivalents_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_BalanceSheet_CashEquivalents_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashEquivalentsBalanceSheet()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashEquivalentsBalanceSheet(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,131 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Filing date of the Cash Flow Statement.
/// </summary>
public class CashFlowFileDate : MultiPeriodField<DateTime>
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public DateTime OneMonth => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_OneMonth);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public DateTime TwoMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwoMonths);
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public DateTime ThreeMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public DateTime SixMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public DateTime NineMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public DateTime TwelveMonths => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(DateTime), FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override DateTime Value
{
get
{
var defaultValue = FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CFFileDate_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, DateTime> GetPeriodValues()
{
var result = new Dictionary<string, DateTime>();
foreach (var kvp in new[] { new Tuple<string, DateTime>("1M", OneMonth), new Tuple<string, DateTime>("2M", TwoMonths), new Tuple<string, DateTime>("3M", ThreeMonths), new Tuple<string, DateTime>("6M", SixMonths), new Tuple<string, DateTime>("9M", NineMonths), new Tuple<string, DateTime>("12M", TwelveMonths) })
{
if (!BaseFundamentalDataProvider.IsNone(typeof(DateTime), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override DateTime GetPeriodValue(string period) => FundamentalService.Get<DateTime>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CFFileDate_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFileDate()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFileDate(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash generated by or used in financing activities of continuing operations; excludes cash flows from discontinued operations.
/// </summary>
public class CashFlowFromContinuingFinancingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFlowFromContinuingFinancingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFromContinuingFinancingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFromContinuingFinancingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash generated by or used in investing activities of continuing operations; excludes cash flows from discontinued operations.
/// </summary>
public class CashFlowFromContinuingInvestingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFlowFromContinuingInvestingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFromContinuingInvestingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFromContinuingInvestingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash generated by or used in operating activities of continuing operations; excludes cash flows from discontinued operations.
/// </summary>
public class CashFlowFromContinuingOperatingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the TwoMonths period value for the field
/// </summary>
[JsonProperty("2M")]
public double TwoMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwoMonths);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("2M",TwoMonths), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFlowFromContinuingOperatingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFromContinuingOperatingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFromContinuingOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The aggregate amount of cash flow from discontinued operation, including operating activities, investing activities, and financing activities.
/// </summary>
public class CashFlowFromDiscontinuedOperationCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFlowFromDiscontinuedOperation_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFromDiscontinuedOperationCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFromDiscontinuedOperationCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The growth in the company's cash flows from financing on a percentage basis. Morningstar calculates the growth percentage based on the financing cash flows reported in the Cash Flow Statement within the company filings or reports.
/// </summary>
public class CashFlowFromFinancingGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromFinancingGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CashFlowfromFinancingGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFromFinancingGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFromFinancingGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The growth in the company's cash flows from investing on a percentage basis. Morningstar calculates the growth percentage based on the cash flows from investing reported in the Cash Flow Statement within the company filings or reports.
/// </summary>
public class CashFlowFromInvestingGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashFlowFromInvestingGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CashFlowfromInvestingGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowFromInvestingGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowFromInvestingGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The net cash from (used in) all of the entity's operating activities, including those of discontinued operations, of the reporting entity under the direct method.
/// </summary>
public class CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_OneMonth);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFlowsfromusedinOperatingActivitiesDirect_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash generated by or used in financing activities of discontinued operations; excludes cash flows from continued operations.
/// </summary>
public class CashFromDiscontinuedFinancingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFromDiscontinuedFinancingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFromDiscontinuedFinancingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFromDiscontinuedFinancingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The net cash inflow (outflow) from discontinued investing activities over the designated time PeriodAsByte.
/// </summary>
public class CashFromDiscontinuedInvestingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFromDiscontinuedInvestingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFromDiscontinuedInvestingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFromDiscontinuedInvestingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The net cash from (used in) all of the entity's discontinued operating activities, excluding those of continued operations, of the reporting entity.
/// </summary>
public class CashFromDiscontinuedOperatingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashFromDiscontinuedOperatingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashFromDiscontinuedOperatingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashFromDiscontinuedOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The net cash from an entity's operating activities before real cash inflow or outflow for Dividend, Interest, Tax, or other unclassified operating activities.
/// </summary>
public class CashGeneratedfromOperatingActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashGeneratedfromOperatingActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashGeneratedfromOperatingActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashGeneratedfromOperatingActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash paid out for insurance activities during the period in operating cash flow, using the direct method. This item is usually only available for insurance industry
/// </summary>
public class CashPaidforInsuranceActivitiesCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashPaidforInsuranceActivities_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashPaidforInsuranceActivitiesCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashPaidforInsuranceActivitiesCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash paid out to reinsurers in operating cash flow, using the direct method. This item is usually only available for insurance industry
/// </summary>
public class CashPaidtoReinsurersCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashPaidtoReinsurers_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashPaidtoReinsurersCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashPaidtoReinsurersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash paid for deposits by banks and customers in operating cash flow, using the direct method. This item is usually only available for bank industry
/// </summary>
public class CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_OneMonth);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashPaymentsforDepositsbyBanksandCustomers_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash paid for loans in operating cash flow, using the direct method. This item is usually only available for bank industry
/// </summary>
public class CashPaymentsforLoansCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashPaymentsforLoans_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashPaymentsforLoans_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashPaymentsforLoansCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashPaymentsforLoansCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,107 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Indicates a company's short-term liquidity, defined as short term liquid investments (cash, cash equivalents, short term investments) divided by current liabilities.
/// </summary>
public class CashRatio : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_OneYear);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_ThreeMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatio_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3M",ThreeMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CashRatio_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashRatio()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashRatio(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,113 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// The growth in the company's cash ratio on a percentage basis. Morningstar calculates the growth percentage based on the short term liquid investments (cash, cash equivalents, short term investments) divided by current liabilities reported in the Balance Sheet within the company filings or reports.
/// </summary>
public class CashRatioGrowth : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "OneYear";
/// <summary>
/// Gets/sets the OneYear period value for the field
/// </summary>
[JsonProperty("1Y")]
public double OneYear => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_OneYear);
/// <summary>
/// Gets/sets the ThreeYears period value for the field
/// </summary>
[JsonProperty("3Y")]
public double ThreeYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_ThreeYears);
/// <summary>
/// Gets/sets the FiveYears period value for the field
/// </summary>
[JsonProperty("5Y")]
public double FiveYears => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_FiveYears);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_OneYear));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.OperationRatios_CashRatioGrowth_OneYear);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1Y",OneYear), new Tuple<string, double>("3Y",ThreeYears), new Tuple<string, double>("5Y",FiveYears) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"OperationRatios_CashRatioGrowth_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashRatioGrowth()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashRatioGrowth(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,125 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash received from banks and customer deposits in operating cash flow, using the direct method. This item is usually only available for bank industry
/// </summary>
public class CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the OneMonth period value for the field
/// </summary>
[JsonProperty("1M")]
public double OneMonth => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_OneMonth);
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("1M",OneMonth), new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashReceiptsfromDepositsbyBanksandCustomers_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}
@@ -0,0 +1,119 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2023 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;
using System.Linq;
using Python.Runtime;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Data.UniverseSelection;
namespace QuantConnect.Data.Fundamental
{
/// <summary>
/// Cash received from agency fees and commissions in operating cash flow, using the direct method. This item is usually available for bank and insurance industries
/// </summary>
public class CashReceiptsfromFeesandCommissionsCashFlowStatement : MultiPeriodField
{
/// <summary>
/// The default period
/// </summary>
protected override string DefaultPeriod => "TwelveMonths";
/// <summary>
/// Gets/sets the ThreeMonths period value for the field
/// </summary>
[JsonProperty("3M")]
public double ThreeMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_ThreeMonths);
/// <summary>
/// Gets/sets the SixMonths period value for the field
/// </summary>
[JsonProperty("6M")]
public double SixMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_SixMonths);
/// <summary>
/// Gets/sets the NineMonths period value for the field
/// </summary>
[JsonProperty("9M")]
public double NineMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_NineMonths);
/// <summary>
/// Gets/sets the TwelveMonths period value for the field
/// </summary>
[JsonProperty("12M")]
public double TwelveMonths => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths);
/// <summary>
/// Returns true if the field contains a value for the default period
/// </summary>
public override bool HasValue => !BaseFundamentalDataProvider.IsNone(typeof(double), FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths));
/// <summary>
/// Returns the default value for the field
/// </summary>
public override double Value
{
get
{
var defaultValue = FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, FundamentalProperty.FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_TwelveMonths);
if (!BaseFundamentalDataProvider.IsNone(typeof(double), defaultValue))
{
return defaultValue;
}
return base.Value;
}
}
/// <summary>
/// Gets a dictionary of period names and values for the field
/// </summary>
/// <returns>The dictionary of period names and values</returns>
public override IReadOnlyDictionary<string, double> GetPeriodValues()
{
var result = new Dictionary<string, double>();
foreach (var kvp in new[] { new Tuple<string, double>("3M",ThreeMonths), new Tuple<string, double>("6M",SixMonths), new Tuple<string, double>("9M",NineMonths), new Tuple<string, double>("12M",TwelveMonths) })
{
if(!BaseFundamentalDataProvider.IsNone(typeof(double), kvp.Item2))
{
result[kvp.Item1] = kvp.Item2;
}
}
return result;
}
/// <summary>
/// Gets the value of the field for the requested period
/// </summary>
/// <param name="period">The requested period</param>
/// <returns>The value for the period</returns>
public override double GetPeriodValue(string period) => FundamentalService.Get<double>(TimeProvider.GetUtcNow(), SecurityIdentifier, Enum.Parse<FundamentalProperty>($"FinancialStatements_CashFlowStatement_CashReceiptsfromFeesandCommissions_{ConvertPeriod(period)}"));
/// <summary>
/// Creates a new empty instance
/// </summary>
public CashReceiptsfromFeesandCommissionsCashFlowStatement()
{
}
/// <summary>
/// Creates a new instance for the given time and security
/// </summary>
public CashReceiptsfromFeesandCommissionsCashFlowStatement(ITimeProvider timeProvider, SecurityIdentifier securityIdentifier) : base(timeProvider, securityIdentifier)
{
}
}
}

Some files were not shown because too many files have changed in this diff Show More