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

Autogenerated Partial Classes are not generating correctly

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

    Autogenerated Partial Classes are not generating correctly

    I'm converting an indicator from NT7 code to NT8.
    I make my changes to the NT7 code from within the NT8 editor, and largely ignore the auto-generated partial class definitions that the compiler automatically places at the bottom of the indicator (as we should).

    I finish making my changes to my code, and compile the indicator. Compilation to NT8 is successful (the indicator runs on a chart just fine). However, the auto-generated partial classes are not correct. Usually, none of the parameters in the indicator are included in the NT8 auto-generated partial class definitions.

    So how do I compile the indicator in NT8 and have the auto-generated partial classes accurately contain all of my parameter definitions in the partial class signatures?

    Without accurate class definitions down there, it makes it nearly impossible to call my translated indicators from other indicators.

    #2
    Hello sbgtrading, and thank you for your question.

    While it is true that users do not have control over the automatically generated code in NinjaTrader 8, NinjaTrader 8 does include an enhanced feature which will allow you to edit NinjaScript code in external editors. Every time you save your NinjaScript code in an external editor with a NinjaScript editor open, Ninja will detect this has happened, recompile your software, and should there be any compile time errors, inform you through the NinjaScript editor.

    You can take advantage of this fact to manually edit the auto-generated code in an external editor to include whatever information you deem necessary.

    Please let us know if we can help in any other way.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by sbgtrading View Post
      I'm converting an indicator from NT7 code to NT8.
      I make my changes to the NT7 code from within the NT8 editor, and largely ignore the auto-generated partial class definitions that the compiler automatically places at the bottom of the indicator (as we should).

      I finish making my changes to my code, and compile the indicator. Compilation to NT8 is successful (the indicator runs on a chart just fine). However, the auto-generated partial classes are not correct. Usually, none of the parameters in the indicator are included in the NT8 auto-generated partial class definitions.

      So how do I compile the indicator in NT8 and have the auto-generated partial classes accurately contain all of my parameter definitions in the partial class signatures?

      Without accurate class definitions down there, it makes it nearly impossible to call my translated indicators from other indicators.
      Did you properly decorate the Properties with the [NinjaScriptProperty] attribute?

      Comment


        #4
        Thanks Koganam,

        That solved the problem

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,606 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        13 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X