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

(temporarily) not plot on chart but still calculate plot

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

    (temporarily) not plot on chart but still calculate plot

    Is there a way to not plot to the chart yet still go through the calculations. It would be necessary that the calculated values still be seen by the data box and program output, and can be used by subsequent calculations.

    It would be best if this could be toggled during OnBarUpdate() without wasting resource by creating an entire duplicate DataSeries. Because that waste is unacceptable especially on a single threaded process.

    BTW, did you know that if you set a plot to Color.Transparent, it no longer shows in the data box? That's bad! The value should still be displayed in the data box.

    #2
    Lost Trader, modern computers will have no performance issue with setting a duplicate data series. You can run through all of the calculations and then store the result into a variable and then just set just one (or both) data series after the calculations, like this:
    Code:
    OnBarUpdate()
    {
       myIndicatorValue = x + y - z; //insert actual calculation logic here
       
       if (doPlot)
       {
           Plot.Set(myIndicatorValue);
           secondDataSeries.Set(myIndicatorValue);
       }
       else //no plot
       {
          secondDataSeries.Set(myIndicatorValue);
       }
    }
    Once you have the secondary data series, you can expose that series to be able to view it in the data box and such.

    And yes, we are aware the plot doesn't appear in the data box if the color is set to transparent.
    AustinNinjaTrader Customer Service

    Comment


      #3
      modern computers will have no performance issue with setting a duplicate data series.
      Hogwash. I have a quad-core 2.8 GHz and NT is consistently capped at 25% CPU.

      I have seen that Multicharts can delay the chart plotting and had hoped NT would consider it as well, without wasting resource. Too bad.

      Comment


        #4
        Lost Trader, how many charts do you have open, and what are their time frames? Are you running multiple strategies at once? Any computationally intensive indicators other than just duplicating a data series? NinjaTrader should not be using an entire core unless you are constantly backtesting/optimizing.

        On my three year old personal PC (dual core), I have a set of scripts exporting all the incoming chart data (best bid/ask and ticks for ~30 instruments) into a MySQL database via hundreds of text commands (strings strung together, not a very efficient process) per second, and the CPU usage doesn't get above 10%, even during market open and close.

        On my new work PC, I haven't seen the usage go above 4% yet other than for backtesting or opening up a new chart.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Austin, with respect, I do not want to de-rail this topic into computer performance issues. I just wanted to know if there were an efficient way to delay or enable/disable the drawing.

          FYI, v6.5 single bar series. No strategies at all. 1-2 real-time tick (Volume) charts. Recording incoming tick data for replay until I realized that was a waste of time. I have no doubt the indicators are intensive, hence I always look for the most efficient coding for my own stuff. I am in process of converting the indicators to NT7 and a two bar series. Sir, any further discussion of this topic should be off-line. Thank you.

          Comment


            #6
            Lost Trader, thank you for your reply. The most efficient way to to "disable" the drawing would be to create a duplicate data series, and then expose that data series.

            Once you get all your code ported to NT7, please let us know if you are still experiencing performance issues.
            AustinNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by zstheorist, Today, 07:52 PM
            0 responses
            3 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            149 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            5 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            5 views
            0 likes
            Last Post tkaboris  
            Working...
            X