Your interactive trading laboratory!
 • 
19 users online

Quantacula Help

How-To
C# API Reference
Extensions
Development Blog
API-Extensions
Indicator Spotlights

QCommunity Extensions
The open-source GitHub repository of source code for the QCommunity Extensions library. Contains indicators and other extensions submitted by the Quantacula Community. Look for QCommunity indicators when you create a Building Block model, mark the "QCommunity" library check box to expose them.

TASC-Extensions
The open-source GitHub repository of source code for the TASCExtensions Quantacula extension. Contains indicators and other extensions adapted from the Traders' Tips articles in Technical Analysis of Stocks & Commodities magazine.
FundamentalDataPoint
Namespace: Quantacula.Core
Parent: Object

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.

Members

Data
public string Data

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.


Date
public DateTime Date

Returns the date that the fundamental data item was reported.

Example Code
using 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)
		{
		}
	}
}

InCurrentRange
public bool InCurrentRange(BarHistory bh)

Returns true if the fundamental data item's Date falls within the historical data that is currently contained in the BarHistory specified in bh.


ItemName
public string ItemName

Returns the name of the fundamental data point, for example Split or Dividend.

Example Code
using 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)
		{
		}
	}
}

Text
public virtual string Text

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 Code
using 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)
		{
		}
	}
}

Value
public double Value

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 Code
using 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)
		{
		}
	}
}