Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

B8 exports invalid package CS

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

    B8 exports invalid package CS

    The export appears to be treating shared helper classes as indicators, even though they aren't derived from Indicator.

    *** EDIT*** The other, related issue is that it looks like the "NinjaTrader.NinjaScript.Indicators" (also "NinjaTrader.NinjaScript.AddOns" and the other top-level namespaces) are magic in a lot of places, such as code gen, import and export. This is really problematic in that it basically restricts code in these folders/namespaces to a single file. IMO, this is just not realistic and definitely was not the case with NT7. Hopefully this is just an oversight and isn't by design.


    1) Add the 2 attached scripts to the Indicators folder. Compile. Notice the indicator uses the helper class in the (State == State.Configure) block.

    2) Export the files (see attached image).

    3) An invalid .cs is created which can't be compiled during import. See red highlights...

    public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    {

    private MyCustomIndicator[] cacheMyCustomIndicator;
    private Some.Namespace.[] cacheSome.Namespace.;


    public MyCustomIndicator MyCustomIndicator()
    {
    return MyCustomIndicator(Input);
    }

    public Some.Namespace. Some.Namespace.()
    {
    return Some.Namespace.(Input);
    }




    public MyCustomIndicator MyCustomIndicator(ISeries<double> input)
    {
    if (cacheMyCustomIndicator != null)
    for (int idx = 0; idx < cacheMyCustomIndicator.Length; idx++)
    if ( cacheMyCustomIndicator[idx].EqualsInput(input))
    return cacheMyCustomIndicator[idx];
    return CacheIndicator<MyCustomIndicator>(new MyCustomIndicator(), input, ref cacheMyCustomIndicator);
    }

    public Some.Namespace. Some.Namespace.(ISeries<double> input)
    {
    if (cacheSome.Namespace. != null)
    for (int idx = 0; idx < cacheSome.Namespace..Length; idx++)
    if ( cacheSome.Namespace.[idx].EqualsInput(input))
    return cacheSome.Namespace.[idx];
    return CacheIndicator<Some.Namespace.>(new Some.Namespace.(), input, ref cacheSome.Namespace.);
    }


    }
    Attached Files
    Last edited by RanchoDinero; 01-27-2016, 11:24 AM.

    #2
    bumpity bump

    Comment


      #3
      Hello,

      Thank you for providing the sample on this,

      I do see that exporting this code does create an error, I will report this to development for further review.

      After further review I will reply back if I have additional details.

      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, Yesterday, 10:06 AM
      0 responses
      14 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      11 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      9 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      4 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      31 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X