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 Ndakotan1313, 03-14-2024, 05:02 PM
          2 responses
          58 views
          0 likes
          Last Post blaise_code  
          Started by claxxical, 05-30-2017, 12:30 PM
          37 responses
          4,454 views
          0 likes
          Last Post Padan
          by Padan
           
          Started by SugarDefwebsite, Today, 02:18 AM
          0 responses
          4 views
          0 likes
          Last Post SugarDefwebsite  
          Started by usglucofreeze, Today, 01:19 AM
          0 responses
          7 views
          0 likes
          Last Post usglucofreeze  
          Started by f.saeidi, Today, 01:12 AM
          0 responses
          16 views
          0 likes
          Last Post f.saeidi  
          Working...
          X