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

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.
    Paul H.NinjaTrader Customer Service

    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.
      Paul H.NinjaTrader Customer Service

      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
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Hi Paul,

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

            regards,

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RubenCazorla, 08-30-2022, 06:36 AM
            3 responses
            77 views
            0 likes
            Last Post PaulMohn  
            Started by f.saeidi, Yesterday, 12:14 PM
            9 responses
            23 views
            0 likes
            Last Post f.saeidi  
            Started by Tim-c, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post Tim-c
            by Tim-c
             
            Started by FrancisMorro, Today, 03:24 AM
            0 responses
            5 views
            0 likes
            Last Post FrancisMorro  
            Started by Segwin, 05-07-2018, 02:15 PM
            10 responses
            1,772 views
            0 likes
            Last Post Leafcutter  
            Working...
            X