FundamentalData

View as Markdown

Definition

FundamentalData is used to access fundamental snapshot data and for subscribing to fundamental data events.

Remember to unsubscribe if you are no longer using the subscription.

Properties

PropertyDescription
AverageDailyVolumeA double representing the average daily volume
BetaA double representing the beta
CalendarYearHighA double representing the high price of the calendar year
CalendarYearHighDateA DateTime representing the date of the calendar year’s high price
CalendarYearLowA double representing the low price of the calendar year
CalendarYearLowDateA DateTime representing the date of the calendar year’s low price
CurrentRatioA double representing the current ratio
DividendAmountA double representing the dividend amount
DividendPayDateA DateTime representing the date dividends are paid
DividendYieldA double representing the dividend yield
EarningsPerShareA double representing the earnings per share
FiveYearsGrowthPercentageA double representing the 5yr growth percent
High52WeeksA double representing the 52 week high
High52WeeksDateA DateTime representing the date of the 52 week high price
HistoricalVolatilityA double representing the historical volatility
InsiderOwnedA double representing the insider owned amount
InstrumentAn Instrument representing the instrument
Low52WeeksA double representing the 52 week low
Low52WeeksDateA DateTime representing the date of the 52 week low price
MarketCapA double representing the market capitalization
NextYearsEarningsPerShareA double representing next year’s earnings per share
PercentHeldByInstitutionsA double representing the percent held by institutions
PriceEarningsRatioA double representing the P/E ratio
RevenuePerShareA double representing the revenue per share
SharesOutstandingA long representing the shares outstanding
ShortInterestA double representing the short interest
ShortInterestRatioA double representing the short interest ratio
VWAPA double representing the VWAP
UpdateEvent handler for subscribing/unsubscribing to market depth events

Syntax

FundamentalData

Examples

1// Example of subscribing/unsubscribing to fundamental data from an Add On. The concept can be carried over
2// to any NinjaScript object you may be working on.
3public class MyAddOnTab : NTTabPage
4{
5 private Instrument instrument;
6
7 public MyAddOnTab()
8 {
9 instrument = Instrument.GetInstrument("AAPL");
10
11 if (instrument == null)
12 return;
13
14 // Subscribe to fundamental data. Snapshot data is provided right on subscription
15 if (!instrument.Dispatcher.HasShutdownStarted)
16 instrument.Dispatcher.InvokeAsync(() => instrument.FundamentalData.Update += OnFundamentalData);
17
18 // Printing snapshot fundamental data for average daily volume
19 NinjaTrader.Code.Output.Process(instrument.FundamentalData.AverageDailyVolume, PrintTo.OutputTab1);
20 }
21
22 // This method is fired on fundamental data events
23 private void OnFundamentalData(object sender, FundamentalDataEventArgs e)
24 {
25 // Do something with fundamental data events
26 }
27
28 // Called by TabControl when tab is being removed or window is closed
29 public override void Cleanup()
30 {
31 // Make sure to unsubscribe to the fundamental data subscription
32 if (instrument != null)
33 instrument.FundamentalData.Update -= OnFundamentalData;
34 }
35
36 // Other required NTTabPage members left out for demonstration purposes. Be sure to add them in your own code.
37}