Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

error CS1061 when exporting, but works fine when compiling inside the editor.

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

    error CS1061 when exporting, but works fine when compiling inside the editor.

    Hello, I have an indicator inside Indicators/LuxAlgo
    and all my indicators are inside namespace NinjaTrader.NinjaScript.Indicators.LuxAlgo

    inside that folder I have a pineLib.cs file that contains my pineLib class
    Code:
    namespace NinjaTrader.NinjaScript.Indicators.LuxAlgo
    {
        public class pineLib
        {​
            public pineLib(NinjaScriptBase thisOwner, NinjaTrader.Gui.NinjaScript.IndicatorRenderBase RenderBase, Indicator thisIndicator, NinjaTrader.Gui.NinjaScript.IDrawObjects thisdrawObjects, int maxObjectsLimit = 5000)
            {
                // stuff here​
            }
        }
    }
    and I define this class in all my indicators as a global variable inside the Indicator class
    protected static pineLib pine;

    and inside State.DataLoaded I initialize it as such
    pine = new pineLib(this, this, this, DrawObjects);​

    anyways this works just fine and everything compiles and works on the chart

    inside the pineLib I have
    Code:
                public ISeries<double> highest(int length)                             { return indicator.MAX(owner.High, length); }
                public ISeries<double> highest(ISeries<double> source, int length)     { return indicator.MAX(source, length); }
    
                public ISeries<double> lowest(int length)                             { return indicator.MIN(owner.Low, length); }
                public ISeries<double> lowest(ISeries<double> source, int length)     { return indicator.MIN(source, length); }
    
                public ISeries<double> ema(ISeries<double> source, int length)     { return indicator.EMA(source, length); }
                public ISeries<double> sma(ISeries<double> source, int length)     { return indicator.SMA(source, length); }
    
                public ISeries<double> atr(int length) { return indicator.ATR(length); }
    
                public double stoch(ISeries<double> source, ISeries<double> high, ISeries<double> low, int length, int offset = 0) { return 100 * (source[offset] - lowest(low, length)[offset]) / (highest(high, length)[offset] - lowest(low, length)[offset]); }
    ​
    ​​

    this is to make things easier when converting from Pine Script to NinjaScript
    now this all works just fine and never caused me problems

    but when I want to export an indicator, that doesn't even use ANY of these above functions
    I get this errors
    Code:
    Error compiling export assembly: c:\Users\sebak\Documents\NinjaTrader 8\bin\Custom\Indicators\LuxAlgo\pineLib.cs(324,91) : error CS1061: 'NinjaTrader.NinjaScript.Indicators.Indicator' does not contain a definition for 'MAX' and no extension method 'MAX' accepting a first argument of type 'NinjaTrader.NinjaScript.Indicators.Indicator' could be found (are you missing a using directive or an assembly reference?)
    Error compiling export assembly: c:\Users\sebak\Documents\NinjaTrader 8\bin\Custom\Indicators\LuxAlgo\pineLib.cs(329,90) : error CS1061: 'NinjaTrader.NinjaScript.Indicators.Indicator' does not contain a definition for 'MIN' and no extension method 'MIN' accepting a first argument of type 'NinjaTrader.NinjaScript.Indicators.Indicator' could be found (are you missing a using directive or an assembly reference?)
    Error compiling export assembly: c:\Users\sebak\Documents\NinjaTrader 8\bin\Custom\Indicators\LuxAlgo\pineLib.cs(328,72) : error CS1061: 'NinjaTrader.NinjaScript.Indicators.Indicator' does not contain a definition for 'MIN' and no extension method 'MIN' accepting a first argument of type 'NinjaTrader.NinjaScript.Indicators.Indicator' could be found (are you missing a using directive or an assembly reference?)
    Error compiling export assembly: c:\Users\sebak\Documents\NinjaTrader 8\bin\Custom\Indicators\LuxAlgo\pineLib.cs(332,87) : error CS1061: 'NinjaTrader.NinjaScript.Indicators.Indicator' does not contain a definition for 'EMA' and no extension method 'EMA' accepting a first argument of type 'NinjaTrader.NinjaScript.Indicators.Indicator' could be found (are you missing a using directive or an assembly reference?)
    Error compiling export assembly: c:\Users\sebak\Documents\NinjaTrader 8\bin\Custom\Indicators\LuxAlgo\pineLib.cs(323,73) : error CS1061: 'NinjaTrader.NinjaScript.Indicators.Indicator' does not contain a definition for 'MAX' and no extension method 'MAX' accepting a first argument of type 'NinjaTrader.NinjaScript.Indicators.Indicator' could be found (are you missing a using directive or an assembly reference?)

    now it's also weird that it doesn't seems to mind SMA and ATR
    how do I fix this issue? let me know if more information is needed.
    Last edited by LuxSpuzy; 06-26-2023, 08:29 AM.

    #2
    Hello LuxSpuzy,

    The MAX() and MIN() are indicators. Try explicitly adding these indicators to the export in the export window.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I can't because they're built in indicators. they don't appear on the export list.
      also usually indicators that are used but not inside pineLib automatically get exported, I guess since this is a separate file that requests it might mess up?

      Comment


        #4
        Hello LuxSpuzy,

        System indicators like MAX and MIN show in the export window when System Indicators is selected in the drop-down.

        All files the script references should be included with the export.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          okay, it worked after doing that, but I have 60 indicators that use pineLib, and doing this for each everytime I make a new one will be a pain, is there a way to actually fix this issue? this seems like a Ninjaeditor bug. I could thankfully remove all the indicator calls from pineLib file but it seems like it would of been a pain if I wasn't able to do that.
          can we make this a feature request for future updates?

          Comment


            #6
            Hello LuxSpuzy,

            I've submitted your request for the development team to consider. Once I have a tracking ID for this I will post in this thread for future reference.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              This does happen from time to time that system indicators need to be explicitly included. Normally they are included when needed automatically, but there are some technical circumstances where it seems to fail to include them and you have to include them manually to get it to go. In your case, it's probably because the indicator you're exporting doesn't reference the nested indicators but rather it's in your common framework code, and it doesn't recognize that sort of chain of dependency.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment


                #8
                Hello,

                This request is being tracked with ID # SFT-6003.

                Please note, we receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing, so we cannot offer an ETA or promise of fulfillment.

                When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number may be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

                Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                113 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                60 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                40 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                43 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                81 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X