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.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ageeholdings, Today, 07:43 AM
      0 responses
      7 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      12 views
      0 likes
      Last Post burtoninlondon  
      Working...
      X