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 Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      2 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,771 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      945 views
      0 likes
      Last Post spwizard  
      Working...
      X