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

Convert NT7 Slope-of-SMA to NT8

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

    Convert NT7 Slope-of-SMA to NT8

    I have some base code from NT7 I'd like to get into NT8....it calculates the degree/slope of a Moving Average

    (originally from Futures.IO forum)

    in NT7 it does a Plot Override to get these arguments

    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)

    then gets the number of bars on the panel....

    that is what I need to get in NT8, not sure by reading the NT8 documentation how this would convert????

    (that is the question..)




    These are passed to CalcSlope() for the calculation

    (see attached code...not intended for compile....as the override is from NT7)

    the calculation code would be platform independent

    thanks



    Attached Files

    #2
    Hello llanqui,

    Thanks for your post.

    Using public override void Plot() is not a documented/supported method in NinjaTrader 7.

    If you want to place regular plots you could use AddPlot() in NinjatTrader 8.

    AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm

    If you are wanting to custom render objects on a chart, this would be OnRender() in NinjaTrader 8.

    Here is a forum thread about this topic which you might find helpful: https://forum.ninjatrader.com/forum/...de-plot​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Yes, I know it was not supported in NT7. that is why the guys at Futures.IO provided it

      I'm talking about NT8

      I guess the question is....how do I map the arguments from this NT7

      public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)

      to this NT8

      protected override void OnRender(ChartControl chartControl, ChartScale chartScale)

      Anyone?

      Thanks

      Comment


        #4
        Hello llanqui,

        Thanks for your note.

        Since public override void Plot() is not a documented/supported method in NinjaTrader 7 it would go beyond the support we are able to provide regarding exactly how the arguments in that unsupported method would translate to OnRender() in NinjaTrader 8.

        You could consider studying using SharpDX in OnRender() in NinjaTrader 8 to see how to custom render objects on a chart and try converting the logic from the script to OnRender().

        Using SharpDX for custom chart rendering: https://ninjatrader.com/support/help..._rendering.htm

        That said, this forum thread will be open for other community members to share their insights on how that unsupported code might translate to NinjaTrader 8.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Ok, thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Graci117, 06-19-2024, 01:39 PM
          4 responses
          35 views
          0 likes
          Last Post Graci117  
          Started by VivaSlimCA, Today, 11:25 AM
          0 responses
          3 views
          0 likes
          Last Post VivaSlimCA  
          Started by RISKYBUSINEZZ, Today, 10:53 AM
          0 responses
          3 views
          0 likes
          Last Post RISKYBUSINEZZ  
          Started by yossefbn, 03-20-2024, 11:39 PM
          4 responses
          51 views
          0 likes
          Last Post RISKYBUSINEZZ  
          Started by RockHardFormulaCA, Today, 09:55 AM
          0 responses
          5 views
          0 likes
          Last Post RockHardFormulaCA  
          Working...
          X