Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Series

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

    Custom Series

    Hello,

    I have created a custom series, Series<T>, that stores information related to each bar on the chart. Is there a way of setting values for the series without synchronizing the "barsAgo" pointer via the TriggerCustomEvent() method? Since there is already the method mySeries.GetValueAt(), I am simply wondering if there is an equivalent mySeries.SetValueAt(). I must be missing something here. Any help would be greatly appreciated. Thank you.

    #2
    Hello Zeos6,

    Custom Series objects have to be synchronized to another series.

    If you are wanting a collection that is not related to bars you can use a C# Array or List.
    http://dotnetperls.com/array
    http://www.dotnetperls.com/list
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea B,

      Thank you for your reply. The reason this issue came up is that I am working on a custom ChartStyle. I calculate some custom bar specific data and I wanted to save the data in a Series<T>. Whilst I can create the series, I am not able to save the data to it, precisely because of the pointer synchronization issue. That is the reason I was inquiring about the mySeries.SetValueAt() functionality for the Series object since it would bypass the need for pointer synchronization.

      As you are aware, the Bar series is not available in ChartStyle except within OnRender(). However, TriggerCustomEvent() is not available in OnRender() inside ChartStyle to allow for synchronization. Is there any workaround for this?

      In the interim, I have done exactly as you suggested and have defaulted to using a thread safe List<T> to store my data..

      Perhaps having the mySeries.SetValueAt() functionality would be a useful feature to implement.

      Thank you.

      Comment


        #4
        Hello Zeos6,

        The Bars object is not the same as a Series<double> object that is native to indicators and strategies, meaning TriggerCustomEvent() only applies to indicators and strategies.

        It sounds like this should be an indicator and not a chart style.
        The chart style is intended for rendering the chart bars only based on the bar information.

        If you are trying to store information, likely this should be done in an indicator and not a chart style.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea,

          I am aware that an indicator could be used to accomplish what I wish to do but I have reasons for doing it via ChartStyles. I wish to render the bars based on a calculation taken from the underlying bar series and thus the initial idea of using a Series<T> object. It seems to me though that simply adding mySeries.SetValueAt() method would be a simple way to extend the functionality of the Series<T> object outside of of Indicators and Strategies.

          In the absence of this solution, however, List<T> with an indexer works fine and as intended.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by neoikon, Today, 05:47 PM
          0 responses
          4 views
          0 likes
          Last Post neoikon
          by neoikon
           
          Started by wjadevries, Today, 03:35 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by Mykro, Today, 03:59 PM
          0 responses
          7 views
          0 likes
          Last Post Mykro
          by Mykro
           
          Started by venkateshdvk, Today, 01:34 PM
          1 response
          27 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by westofpluto, Today, 01:54 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X