Announcement

Collapse
No announcement yet.

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​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Ok, thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          566 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          329 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
          547 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          548 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X