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 Brevo, Today, 01:45 AM
      0 responses
      3 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      240 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      6 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X