Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Transcription code from NInja7 to Ninja8

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

    Transcription code from NInja7 to Ninja8

    Good morning,
    I should transcribe a "Procedure" (), from Ninja7 to Ninja8 but I can not. Attached is the document with the practical example.
    Thank you.
    Roberto
    Attached Files

    #2
    Hello,

    Thank you for the post.

    I am not certain I understand the question, the syntax you have pictured on the left of your image for NT7 can be directly used in NT8 in the same way. You should be able to copy and paste that logic.

    Your method ManageOrder() would also need to be moved if you plan to reuse that syntax in nt8.

    Code:
    if(CurrentBar > 10)
    {
    
    }
    This would still be valid in NT8 to check the CurrentBar is greater than 10.

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

    Comment


      #3
      Hello,
      what I'm interested in is how to transcribe the ManageOrder () because if I copy and paste it gives me an error.

      Comment


        #4
        Hello,

        Thank you for the reply.

        The ManageOrder() is a method, this is not a NinjaScript method so this is likely contianed somewhere in the script you are working on.

        A C# method can be used in NT8 that is not an issue, but the syntax inside of the method may need to be changed to work with NT8. What specifically is not compiling when you copy the method into NT8?

        I would suggest to work slowly and copy the method first without its body or:


        Code:
        private void ManageOrder()
        {
          // comment out the code inside of its body so it can compile
        }
        After moving the method stub or what I have shown above (yours may look different) you could then uncomment a line at a time and find what does not compile.

        We have a comprehensive guide on major changes in NinjaScript at the following link: https://ninjatrader.com/support/help...ng_changes.htm

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

        Comment


          #5
          As you can see from the attachment, the Method () does not work in Ninja8 as it worked on Ninja7.
          How can I do?
          Thank you.
          Roberto
          Attached Files

          Comment


            #6
            Hello,

            Thank you for the reply.

            What you have shown would not be valid C# syntax for a method declaration, you have added a semicolon to the end where the () is which is not present in your NT7 script. You would need to make sure to copy what you have exactly from NT7 in this case.

            It should instead look like the following:

            Code:
            private void ManageOrder()
            {
             
            }

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

            Comment


              #7
              Thank you

              You're right I did not copy. Now works.
              Thank you
              Jesse

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              32 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Started by frankthearm, Today, 09:08 AM
              5 responses
              21 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              43 views
              0 likes
              Last Post jeronymite  
              Working...
              X