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

Complex processing of DataSeries

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

    #16
    I have debugged it and now the data are in a dataseries. The question is how do you plot the dataseries.

    Comment


      #17
      Hi sktrader1,

      Please refer to this sample...
      When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability
      TimNinjaTrader Customer Service

      Comment


        #18
        Just go to tools>edit > indicator and look at just about any indictor code. For example SMA, which is simple. In almost every case you will see a

        .Set(myValue[0])

        ..method...where myValue is your data series.

        Comment


          #19
          Hi mountainclimber,

          Unfortunately, plotting from a strategy does not work in the same way as an indicator.
          TimNinjaTrader Customer Service

          Comment


            #20
            Thanks NinjaTrader that could be useful. Sorry just starting with the software and need to know how things are linked together. If you have more samples for generating the plots during the backtesting too it would be great. mountainclimber I am trying to do something slightly more difficult but eventually I might go backwards and use the primary loop that is in effect the OnBarUpdate if I can - that will utilise this method.

            Comment


              #21
              You can also add plots in a strategy, called from an existing indicator. Something like...

              Code:
              protected override void Initialize()
              {
                          
                 Add(Stochastics(7, 14, 3));
              
              }
              TimNinjaTrader Customer Service

              Comment


                #22
                Oh, didn't realize he was in a strategy...my bad.

                Comment


                  #23
                  Hi NinjaTrader, went through the sample code thanks. Is the reason that this will not work on historical data be that there is not OnBarUpdate event activated?
                  Thanks

                  Comment


                    #24
                    Currently on the previous example I am plotting my output using the following:


                    for(Bar=0;Bar<=Bn;Bar++)
                    {
                    T=Bar.ToString()+"TT";
                    DrawDot(T, false, Bar, Result[Bar], Color.Green);
                    }

                    Where Bn is the Min. Bars required (see below)
                    T plays the role of the unique reference. Works fine. Is that a good accepted solution? Of course this calculates for the last Bn and therefore as there are new bars the old ones are removed from the chart.

                    Comment


                      #25
                      Hi sktrader1,

                      This should work on historical, are you seeing any errors in the Log tab when you apply it to a chart?
                      TimNinjaTrader Customer Service

                      Comment


                        #26
                        Sounds good then. No errors. Is there a guide for a bit more advanced examples around?

                        Comment


                          #27
                          Hi sktrader1,

                          Of the plotting from a strategy? Not that I am aware of, but searching these forums will likely bring up other discussions or even examples on the subject.
                          TimNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Taddypole, 04-26-2024, 02:47 PM
                          1 response
                          12 views
                          0 likes
                          Last Post NinjaTrader_Eduardo  
                          Started by futtrader, 04-21-2024, 01:50 AM
                          6 responses
                          58 views
                          0 likes
                          Last Post futtrader  
                          Started by sgordet, Today, 11:48 AM
                          0 responses
                          4 views
                          0 likes
                          Last Post sgordet
                          by sgordet
                           
                          Started by Trader146, Today, 11:41 AM
                          0 responses
                          5 views
                          0 likes
                          Last Post Trader146  
                          Started by jpapa, 04-23-2024, 07:22 AM
                          2 responses
                          21 views
                          0 likes
                          Last Post rene69851  
                          Working...
                          X