• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding series to custom BarsType

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding series to custom BarsType

    Hello,

    Is there a way to add a series of my own type in a custom BarsType that would then also be accessible to a custom ChartStyle (in addition to the Bars object).

    If I understand correctly the documentation (quoted below) refers to Indicators and not BarsType.

    Thanks you,
    Adi


    Series<T> Objects
    Series<T> is the base class for PriceSeries, TimeSeries, and VolumeSeries. Rather than using one of these pre-defined derived classes, you can create your own Series<T> collection to hold any Type that you choose. The advantage that Series<T> has over other collections is that it can be quickly initialized to contain a number of index slots equal to the number of bars in one of the Bars objects on the chart, with each index slot corresponding to a specific bar.

    #2
    Hello,

    Thank you for the post.

    I am unsure of any way this concept could work, there are no documented or suggested ways to expose anything from a BarsType to a ChartStyle or any other type.

    A BarsType by nature is simply for calculating bars for a series, the other tools like a chart makes use of this process to build the bars you see. A chart uses this request in combination with other types like the ChartStyle to display the bars.

    I believe the help guide note is targeted more specifically at types that reside on a chart like Indicators or Strategies as the series is populated with the number of Bars on the chart. This is more of a system to parallel the existing price data series but to be custom for any type.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse,

      I poked around a little and found that a chart's OnRender(ChartControl chartControl, ChartScale chartScale, ChartBars chartBars) chartBars parameter has a chartBars.Bars.BarsType that references the custom BarsType. When you cast that to the custom BarsType you can access public members.

      Regards,
      Adi

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ballboy11, Today, 01:04 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by Linda1507, Today, 01:22 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by ntbone, Today, 12:15 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by ballboy11, Today, 12:32 PM
      2 responses
      3 views
      0 likes
      Last Post ballboy11  
      Started by brownsfan019, Today, 12:04 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Working...
      X