Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Ninjatrader Charts for data other than Time Series?

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

    Using Ninjatrader Charts for data other than Time Series?

    Hi,

    I have been using Stream Writer within indicator classes that I've written to create text files full of data that I've derived from usual Instrument Time Series Data, indicators, etc...

    I then open these .txt files and run various data analytics functions over them in Visual Studio. This, of course, is not necessary to do outside the scope of ninjatrader, I could always use the output window if all I want is the numeric results, but I always like to visualize my data.

    My question is, is there a pre-existing method for outputting data to the stock NT charts that one would normally use for viewing Time Series data? Upon creating a new chart I can't seem to find any way to change the axes from the standard price(y) and time(x) to my own. Can I override this somehow in my indicator code?

    Is this something that would need to be done as an AddOn? Or is there a pre-existing way to do this that I am not aware of?

    Thank you

    #2
    Hello lunardiplomacy,

    Thanks for your post.

    Charts allow for drawing on them with drawing objects, plotting data from indicators and/or strategies, and custom rendering that is done in indicators and/or strategies. There is not any built in functionality to plot Time Series data. I may suggest reading your data with a StreamReader and then using custom rendering to draw on the chart and present whatever you need from that data.

    To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.



    As for adjusting chart X axis programmatically, we do not offer a supported way to do this. The Y axis can be adjusted programmatically in a limited sense since indicators will draw on the chart and when we have AutoScale enabled, what is drawn by the indicator will be fit to the chart. You could override OnCalculateMinMax to increase the MinValue and MaxValue of an indicator if you would like to adjust the Y axis.

    OnCalculateMinMax - https://ninjatrader.com/support/help...lateminmax.htm

    Further programmatic modifications to chart scales would not be possible out of box and would need to be feature requested.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Sorry Jim,

      Just to make sure that we are understanding each other. You said, "there is not any supported way to plot time series data", I am looking to plot NON time series data. In other words, you are saying that the x-axis MUST be time-based, and I could not theoretically stream read one column of my data to the y-axis and another column to the x-axis? Just as a stupid example, say I wanted to plot 0-100 on the x-axis, and the occurrence of UltimateOscillator values in my data set on the y-axis, I wouldn't be able to?

      That is all I wanted clarification on. If that isn't possible, even programmatically, that would surprise me, not to be rude. The Optimization window generates such a chart, even with an added Z-axis... I don't have access to the creation of such a chart within NT? (not with the z-axis obviously).

      Again, I apologize if you feel like I am asking the same question twice, I just wanted to make sure we are understanding each other.

      Comment


        #4
        Hello lunardiplomacy,

        I was mentioning that there is not an out of box way to plot TimeSeries on a chart. You could draw text that shows the DateTime value of that TimeSeries, but I do not think that is what you are trying to do.

        What is visible on the X axis is controlled by the user when they adjust it to include more/less bars. The bars on the chart determine the "slots" that are created on that chart which give the actual rendering space where bars are drawn (from ChartStyle) and how indicators plot their data. The bars on the chart are determined from the Data Series, which is built by the BarsType and does not necessarily have to be time based. We do not have direct control over the slots of the chart so there isn't really a way to add bars and modify the chart in that fashion.

        I think what this comes down to is that you are looking for your own charting controls which is not offered out of box. You could consider using OnCalculateMinMax to add some space in the ChartPanel where you can do your own rendering with SharpDX, and then you can draw whatever your would like there. You could even create your own chart within that chart panel, but all of that would have to be done using your own code to build that chart.

        If this does not make the matter clearer, could you provide an illustration of what you are trying to accomplish?

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          No, it does make the matter clearer. Thank you, Jim. I was just trying to make my workflow more simple from data gathering to data visualization, it sounds like I should just stick my current method.

          Thanks for clearing this up for me.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ZenCortexCLICK, Today, 04:58 AM
          0 responses
          2 views
          0 likes
          Last Post ZenCortexCLICK  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          172 responses
          2,280 views
          0 likes
          Last Post sidlercom80  
          Started by Irukandji, Yesterday, 02:53 AM
          2 responses
          17 views
          0 likes
          Last Post Irukandji  
          Started by adeelshahzad, Today, 03:54 AM
          0 responses
          4 views
          0 likes
          Last Post adeelshahzad  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X