Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Plotting Sample in NT8 (addition to NT7 version)

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

    Strategy Plotting Sample in NT8 (addition to NT7 version)

    Hello,

    I am not a technical programmer, but the samples Ninjascript do help a lot.

    Please help migrating or provide the "Strategy: Plotting from within a NinjaScript Strategy" sample in the NinjaScript Development forum from NT7 version into NT8 as well (other samples do have both NT7 and NT8 scripts)

    Many thanks...

    #2
    Hello Gustirai,

    Thanks for your post and welcome to the forums.

    We appreciate the feedback on the usefulness of the samples provided. We have converted all of the needed samples to NT8 already. In the case of the plotting within a strategy, this is no longer needed because we have provided the ability to plot within a strategy, using the method AddPlot(): Regrettably our documentation, also in beta, does not reflect this as yet.

    In testing this I found that while I can plot in the price panel I was not able to redirect the plot to a separate panel. I will create a feature request for this capability.

    Comment


      #3
      Hello Gustirai,

      In my previous post I said, "In testing this I found that while I can plot in the price panel I was not able to redirect the plot to a separate panel. I will create a feature request for this capability."

      I need to correct this as in order to plot to a panel outside of the price panel I had forgotten to add IsOverlay = false; in the State == State.SetDefaults. Once IsOverlay is set to false, all plots in the strategy would be placed in a new panel.

      Comment


        #4
        Hi Paul,

        Thanks for the quick response.

        I will try your input into the NT7 version of the Samples script provided.

        If it is possible, it will be useful if a NT8 version be added to the Library. Or can you provide the needed script changes...

        Many thanks again

        Comment


          #5
          Hello Gustirai,

          Thanks for your reply.

          To create a plot within a strategy in NinjaTrader 8 is no different than creating a plot within an indicator. You use the method AddPlot(): http://ninjatrader.com/support/helpG...s/?addplot.htm In state.Defaults.

          Example: AddPlot (Brushes.Blue, "MyHMA");

          In the OnBarUpdate() method you would add the calculations needed and connect that to the output.

          Example: MyHMA[0] = HMA(10)[0];

          In the properties region you then output the values.
          Example:
          [Browsable(false)]
          [XmlIgnore]
          public Series<double> MyHMA
          {
          get { return Values[0]; }
          }

          To assist I've added those items to the SampleMACrossOver strategy (renamed ExampleForGustirai) and commented those lines I added to produce a Blue line HMA plot output. I used an indicator for simplicity, you can replace the HMA with any code calculations you wish that would output a value that is consistent with the price panel.
          Attached Files

          Comment


            #6
            Hi Paul,

            Again, thanks a lot... very useful to me.

            regards,

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            548 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X