FundamentalData
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
| Property | Description |
|---|---|
| AverageDailyVolume | A double representing the average daily volume |
| Beta | A double representing the beta |
| CalendarYearHigh | A double representing the high price of the calendar year |
| CalendarYearHighDate | A DateTime representing the date of the calendar year’s high price |
| CalendarYearLow | A double representing the low price of the calendar year |
| CalendarYearLowDate | A DateTime representing the date of the calendar year’s low price |
| CurrentRatio | A double representing the current ratio |
| DividendAmount | A double representing the dividend amount |
| DividendPayDate | A DateTime representing the date dividends are paid |
| DividendYield | A double representing the dividend yield |
| EarningsPerShare | A double representing the earnings per share |
| FiveYearsGrowthPercentage | A double representing the 5yr growth percent |
| High52Weeks | A double representing the 52 week high |
| High52WeeksDate | A DateTime representing the date of the 52 week high price |
| HistoricalVolatility | A double representing the historical volatility |
| InsiderOwned | A double representing the insider owned amount |
| Instrument | An Instrument representing the instrument |
| Low52Weeks | A double representing the 52 week low |
| Low52WeeksDate | A DateTime representing the date of the 52 week low price |
| MarketCap | A double representing the market capitalization |
| NextYearsEarningsPerShare | A double representing next year’s earnings per share |
| PercentHeldByInstitutions | A double representing the percent held by institutions |
| PriceEarningsRatio | A double representing the P/E ratio |
| RevenuePerShare | A double representing the revenue per share |
| SharesOutstanding | A long representing the shares outstanding |
| ShortInterest | A double representing the short interest |
| ShortInterestRatio | A double representing the short interest ratio |
| VWAP | A double representing the VWAP |
| Update | Event 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. 3 public 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 }

