The FundamentalDataPoint class represents a single piece of fundamental data, such as a split or a dividend. Quantacula Studio supports several fundamental data providers, both included out of the box and available via extensions. Each provider supplies its own set of historical fundamental data.
You can access this fundamental data by using the Fundamentals property or the GetFundamentals method of the BarHistory class.
May contain some string data that is populated by the fundamental data provider that generated this fundamental data item. Each fundamental data provider could use this property to represent different things, so consult with the documentation of the provider's extension for more details.
Returns the date that the fundamental data item was reported.
Example Codeusing Quantacula.Backtest; using Quantacula.Core; using System.Drawing; namespace Quantacula { public class MyModel1 : UserModelBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.Fundamentals.Count > 0) { FundamentalDataPoint fdp = bars.Fundamentals[bars.Fundamentals.Count - 1]; DrawHeaderText("The most recent fundamental item is a " + fdp.ItemName + " reported on " + fdp.Date.ToShortDateString(), Color.Black, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
Returns true if the fundamental data item's Date falls within the historical data that is currently contained in the BarHistory specified in bh.
Returns the name of the fundamental data point, for example Split or Dividend.
Example Codeusing Quantacula.Backtest; using Quantacula.Core; using System.Drawing; namespace Quantacula { public class MyModel1 : UserModelBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.Fundamentals.Count > 0) { FundamentalDataPoint fdp = bars.Fundamentals[bars.Fundamentals.Count - 1]; DrawHeaderText("The most recent fundamental item is a " + fdp.ItemName + " reported on " + fdp.Date.ToShortDateString(), Color.Black, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
Returns descriptive text for this fundamental data point. Generally, this is a combination of the item's ItemName and Value, but different fundamental items can return different strings to express themselves.
Example Codeusing Quantacula.Backtest; using Quantacula.Core; using System.Drawing; namespace Quantacula { public class MyModel1 : UserModelBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.Fundamentals.Count > 0) { FundamentalDataPoint fdp = bars.Fundamentals[bars.Fundamentals.Count - 1]; DrawHeaderText("The most recent fundamental item is a " + fdp.Text, Color.Black, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }
Returns the numeric value associated with the fundamental data point. For example, a 2:1 split would have a Value of 2, while a $1.50 per share dividend would have a Value of 1.5.
Example Codeusing Quantacula.Backtest; using Quantacula.Core; using System.Drawing; namespace Quantacula { public class MyModel1 : UserModelBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { if (bars.Fundamentals.Count > 0) { FundamentalDataPoint fdp = bars.Fundamentals[bars.Fundamentals.Count - 1]; DrawHeaderText("The most recent fundamental item is a " + fdp.ItemName + " with a value of " + fdp.Value.ToString("N2"), Color.Black, 18); } } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { } } }