Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compile errors

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

    Compile errors

    for example, i put this code:

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Globalization;
    using System.Net;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    
    
    namespace NinjaTrader.NinjaScript.Indicators.MyFolderName
    {
    	public class Smth: Indicator
    	{
    
    	  
    	}
    }
    it compiles well. In "NinjaScript generated code i see":

    Code:
    #region NinjaScript generated code. Neither change nor remove.
    
    namespace NinjaTrader.NinjaScript.Indicators
    {
    	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    	{
    		private MyFolderName.Smth[] cacheSmth;
    ....
    but if i add this block above (before "namespace NinjaTrader.NinjaScript.Indicators.MyFolderName"):
    Code:
    using my_namespace3;  
    namespace my_namespace3{
    	public enum XYZ	
    	{
    	    Unknown = 0
    	}
    }
    I get compile errors: The type or namespace name 'Smth' could not be found (are you missing a using directive or an assembly reference?)

    , and in "NinjaScritp generated code" i see:
    Code:
    #region NinjaScript generated code. Neither change nor remove.
    namespace NinjaTrader.NinjaScript.Indicators
    {
    	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    	{
    		private Smth[] cacheSmth;

    so, i dont know why adding namespace removes the "foldername" in NT auto generated code... this happened many times with my NT.
    Last edited by ttodua; 11-24-2017, 12:52 AM.

    #2
    only solution seems:

    Code:
    using  NinjaTrader.NinjaScript.Indicators.MyFolderName.my_namespace3;  
    namespace NinjaTrader.NinjaScript.Indicators.MyFolderName.my_namespace3{
    	public enum XYZ	
    	{
    	    Unknown = 0
    	}
    }

    Comment


      #3
      Hello TazoTodua,

      Thank you for your post.

      As I understand your inquiry you are defining a namespace before the actual indicator. The Auto Generated NinjaScript code is not expecting a namespace to be defined before the actual indicator and thus you receive the error message after attempting the compile.

      Please let me know if you have any questions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, Yesterday, 04:31 AM
      0 responses
      28 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      284 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      281 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      132 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      90 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X