Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Working...
      X