BarsRequest
<< Click to Display Table of Contents >> BarsRequest |
BarsRequest can be used to request Bars data and subscribe to real-time Bars data events.
Notes: 1.When using the DateTime fromLocal and toLocal parameters, the dates are converted to local daily timestamps (12:00 AM) and return a BarsRequest representing full trading days. If you need to request less than one full trading day, please use the barsBack parameter 2.Remember to unsubscribe from the .Update Event handler if you are no longer using the subscription. 3.A BarsRequest provides underlying market data for an instrument, but is not synchronized with an indicator or strategies primary data series. You will need to implement your own BarsUpdateEvent logic. 4.BarsRequest data CANNOT be used as input for a NinjaTrader indicator 5.Performing a BarsRequest in Playback will always yield bars up to the current playback time / slider position. 6.The documented BarsRequest behavior would be the same for all NinjaScript types |
BarsRequest(Cbi.Instrument instrument, int barsBack)
BarsRequest(Cbi.Instrument instrument, DateTime fromLocal, DateTime toLocal)
Instrument |
The Instrument to request |
barsBack |
An int value determining the number of bars to request from the current time |
fromLocal |
A DateTime value determining the starting date to request |
toLocal |
A DateTime value determining the ending date to request |
Bars |
The Bars object returned from the request |
BarsBack |
An int representing the number of bars back used in the request |
BarsPeriod |
The BarsPeriod for the bars request |
FromLocal |
A DateTime representing the starting date used in the request |
IsDividendAdjusted |
A bool representing if the bars request will be dividend adjusted |
IsResetOnNewTradingDay |
A bool representing if the bars request will Break at EOD |
IsSplitAdjusted |
A bool representing if the bars request will be split adjusted |
Instrument |
The Instrument of the bars request |
LookupPolicy |
The lookup policies for the bars request. Possible Values are: •Provider - Queries the provider. The repository is updated on provider's reply •Repository - Looks up the local repository only |
The merge policy for the bars request. |
|
Requests the bars as parametrized |
|
TradingHours |
The trading hours for the bars request |
ToLocal |
A DateTime representing the end date used in the request |
Update |
A BarsUpdateEvent handler for subscribing/unsubscribing to bar update events |
/* Example of subscribing/unsubscribing to bars data events from an Add On as well as making bars requests. |