Definition
The OnFundamentalData() method is called for every change in fundamental data for the underlying instrument.
• | Programming to this method is considered advanced programming and exposed for experienced programmer |
• | This method is not called on historical data (backtest) |
Method Return Value
This method does not return a value.
Method Parameters
FundamentalDataEventArgs e
Syntax
You must override the method in your strategy or indicator with the following syntax.
protected override void OnFundamentalData(FundamentalDataEventArgs e)
{
}
Examples
protected override void OnFundamentalData(FundamentalDataEventArgs e)
{
if (e.FundamentalDataType == FundamentalDataType.CurrentYearsEarningsPerShare)
Print("The current year's EPS is " + e.DoubleValue);
}
|
|
Tips
2. | Do not leave an unused OnFundamentalData() method declared in your NinjaScript object. This will unnecessarily attach a data stream to your strategy which uses unnecessary CPU cycles. |
|