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 TraderIqbal, 10-20-2023, 10:12 AM
        2 responses
        117 views
        0 likes
        Last Post Funnywo
        by Funnywo
         
        Started by Creamers, 04-27-2024, 05:32 AM
        12 responses
        72 views
        0 likes
        Last Post Creamers  
        Started by fredericlebre, Today, 01:19 AM
        0 responses
        4 views
        0 likes
        Last Post fredericlebre  
        Started by TraderJA, Today, 12:06 AM
        0 responses
        7 views
        0 likes
        Last Post TraderJA  
        Started by SnailHorn, Yesterday, 10:49 PM
        0 responses
        9 views
        0 likes
        Last Post SnailHorn  
        Working...
        X