Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Complie error when exporting

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

    Complie error when exporting

    Hi,

    While trying to export a source of my Indicator, I received the following message:
    Error compiling export sources. Please check your logs.
    The indicator is working fine on a chart, smoothly complied and functioning well. When checking the log I see the following error:
    Error compiling export sources: c:\Users\shai\Documents\NinjaTrader 7\bin\Custom\Indicator\bdtPowerPriceAction.cs(1273 ,30) : error CS1061: 'NinjaTrader.Indicator.Indicator' does not contain a definition for 'MAX' and no extension method 'MAX' accepting a first argument of type 'NinjaTrader.Indicator.Indicator' could be found (are you missing a using directive or an assembly reference?)
    Here is the relevant code, identify is the problem:

    Code:
    public class iSegment: Indicator
    {
    			public iSegment(Indicator parent, string name)
    			{
    	            this.parent = parent;
    				iGenericName = name;
    				iName = iGenericName;
    				iComplete = true;
    			}
    
    }
    
    public class PriceAction: iSegment
    {
    			public PriceAction(Indicator parent, string brakeName)
    				:base(parent, brakeName) {}
    
    
      protected override void OnBarUpdate() 
      {
       ...
    
      if (bDir > 0)
        {
    	if (parent.Close[iLast] > parent.Open[iLast])
    		parent.DrawTriangleDown(aName+".ExitTriangle", true, iLast, pExitPrice, tradeResultColor);
    	else
    		parent.DrawTriangleUp(aName+".ExitTriangle", true, iLast, pExitPrice, tradeResultColor);
    	yPos = Math.Min(parent.MIN(textOffsetX + textOffsetXspace)[0], (sDir < 0 ? pPrimaryLine : pSecondaryLine)) - textOffsetY;
    	parent.DrawLine(iName+".ExitGuide", true, iLast, pExitPrice, iLast + textOffsetX, yPos, tradeResultColor, DashStyle.Dash, 1);
    	text = parent.DrawText(aName+".ExitText", true, resultText, iLast+textOffsetX, 
    						yPos, 0, textColor, textFont, textAlign, tradeResultColor, tradeResultColor, textBgOpacity);
    	text.Locked = false;
         ...
    
        }
      }
    }

    #2
    Hi Shai, please add the MAX system indicator method manually to your exported file contents and you should be good then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      You are magician Bertrand, you saved me. It fixed it !

      Maybe you should add a note in the help, so explain this...

      Comment


        #4
        You are welcome - it's noted here in our helpguide, I should have included that firstplace in my reply -

        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks, I see it now. I didn't check, since it was under the ".NET Referencing", which I didn't expect to be relevant.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jclose, Today, 09:37 PM
          0 responses
          4 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,413 views
          0 likes
          Last Post Traderontheroad  
          Started by firefoxforum12, Today, 08:53 PM
          0 responses
          10 views
          0 likes
          Last Post firefoxforum12  
          Started by stafe, Today, 08:34 PM
          0 responses
          10 views
          0 likes
          Last Post stafe
          by stafe
           
          Started by sastrades, 01-31-2024, 10:19 PM
          11 responses
          169 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X