• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Export compiler errors when it compiles in Editor

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

    Export compiler errors when it compiles in Editor

    I have some code, (attached as GTestExport.cs), that compiles fine in the NinjaScript editor. However, when I try to export this code, it gives the compiler errors in attached file (exportErrors.txt).

    The errors are simply references to Ninja provided indicators.

    Is there something wrong in the code?
    Seems like a export bug to me.

    Please advise.

    Thanks,
    Gary
    Attached Files

    #2
    Hello,

    Thank you for the question.

    I see that the Indicator calls you are doing are being made from a Static class, was this intended?

    By making the class public instead of static the export is successful.



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

    Comment


      #3
      The method is static only because I cut/pasted it from a utility class and put it into this dummy indicator so I could send it to you easily.

      I am curious why this is an issue in NT 8. That code compiles and exports just fine in NT 7.

      Are there some constraints put on NT 8 export that were not there for NT 7?
      Can you point to some documentation on this topic?

      Thanks,
      Gary

      Comment


        #4
        Hello,

        Thank you for the reply.

        I am unsure of the original use case or original structure used, but the static method is not the issue here. I had just asked as I was unsure if you had just copied and pasted this from a different type or as you said a utilities file.

        The problem is that the export does not see the static method the same as the base indicator class when used in this manor, or mainly does not search to see if you used EMA in the static method, in that case the export fails because EMA was not included because the actual indicator did not use the EMA at all. This would apply to any of the indicators used.

        A work around for this would be to call the EMA or any used indicator from the calling indicator or:

        protected override void OnBarUpdate()
        {
        double a = EMA(Close, 12)[0];
        }

        After adding the indicators to the main indicator, the export would see that this is required and include it resulting in a export. I will submit this topic for review to check if this would be expected, I would think that this would be expected based on this specific use case, but will reply back once I have any further details.

        I look forward to being of further assistance.
        Last edited by NinjaTrader_Jesse; 12-29-2015, 11:27 AM.
        JesseNinjaTrader Customer Service

        Comment


          #5
          BTW, the keyword 'static' is only on the method. It is not a static class. It is merly a static method within an Indicator and therefore the indicators 'using' statements apply to it (as is shown by the fact that the class compiles fine in NinjaScript editor).

          This is the real point of this thread: I don't think the process of exporting should be any different than compiling in NinjaScript editor. It should use the same 'project' properties and therefore detect the EMA just like it does in NinjaScript editor.

          Why is it different?

          Gary

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pulpiwapi, 03-04-2019, 11:18 PM
          11 responses
          145 views
          0 likes
          Last Post music_p13  
          Started by indy73, Yesterday, 10:52 PM
          3 responses
          18 views
          0 likes
          Last Post sledge
          by sledge
           
          Started by priceisking, Today, 12:51 PM
          1 response
          20 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by chartish, Today, 10:33 AM
          3 responses
          28 views
          0 likes
          Last Post chartish  
          Started by casabella, Today, 11:51 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X