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

Compiling a script from the code

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

    Compiling a script from the code

    Hi

    I want to generate a strategy, add .cs to NinjaTrader.Custom.csproj and run C# compiler after to get NinjaTrader.Custom.dll
    How I could run the compiler from my code?

    #2
    Hello ren37,

    I am not certain I understand the question, are you trying to add some functionality similar to how NT8 auto compiles upon saving with visual studio? Can you explain your goal further?

    In general, there is nothing I can provide to call the compiler from visual studio or from code if this is what you are asking. For NT7 you would need to keep an indicator open (ADL) and compile from that indicator if you are using visual studio as the syntax editor. This has been corrected in NT8 as it now auto compiles when saving.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse

      As I said, first I want to generate source code for a strategy from my add-on. Then I need to compile generated .cs file to use the strategy in Ninja. How can I run built-in C# compiler from my add-on? So I need to do the same thing when you click Compile button in Strategy Builder.

      Comment


        #4
        Hello ren37,

        You noted "add-on" and "strategy builder", is this question for NT8 instead of NT7? If so I will move this to the correct sub forum. NT7 does not have add-ons, do you mean an indicator or strategy?

        In any case, I still would not have a solution in either version of the platform in regard to the compiler. There is no documented/supported way to access the compiler in NinjaTrader from NinjaScript in 7 or 8. If you have an addon that is generating some code and you are using NT8, if you are generating the code into the correct directory for NinjaScript items the platform will detect the change if the NinjaScript editor is open. For NT7 there would be no suggestion I could make other than you need to manually compile from any script such as the ADL to see outside changes.

        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Yes, this is related to Ninja 8
          I think you could add this functionality
          I'm a vendor and I need this for one of my products.
          Thank you

          Comment


            #6
            Hello ren37,

            Thank you for the reply.

            I will put in a feature request for this, once I have a tracking id I will post that here.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rdtdale, Today, 01:02 PM
            0 responses
            1 view
            0 likes
            Last Post rdtdale
            by rdtdale
             
            Started by alifarahani, Today, 09:40 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by RookieTrader, Today, 09:37 AM
            4 responses
            18 views
            0 likes
            Last Post RookieTrader  
            Started by PaulMohn, Today, 12:36 PM
            0 responses
            6 views
            0 likes
            Last Post PaulMohn  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            40 views
            0 likes
            Last Post love2code2trade  
            Working...
            X