Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript Export Issue

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

    Ninjascript Export Issue

    The following error is being generated on (Strategy + The private build Indicator in Use) Ninjascript Export (non-compiled):

    error CS 1061 [Indicator in Use] does not contain a definition for 'SMA' and no accessible extension method 'SMA' accepting a first argument of type [Indicator in Use] could be found (are you missing a using directive or an assembly reference?)

    Notes: This indicator is a privately created construct and else-wise works just fine both on chart and in a created strategy. Attempting to export it however I run into this. The indicator itself appears to be a direct C# build...

    ************************************************** ************************************************** ****************************************

    Here is the Code where this error is being generated:

    double num = 0.0;
    for (int index = Math.Min(((NinjaScriptBase)this).CurrentBar, this.Period - 1); index >= 0; --index)
    num += Math.Abs(((NinjaScriptBase)this).Typical[index] - ((NinjaScriptBase)this.SMA(((NinjaScriptBase)this) .Typical, this.Period))[0]);
    double y = (((NinjaScriptBase)this).Typical[0] - ((NinjaScriptBase)this.SMA(((NinjaScriptBase)this) .Typical, this.Period))[0]) / (num == 0.0 ? 1.0 : 0.015 * (num / (double)Math.Min(this.Period, ((NinjaScriptBase)this).CurrentBar + 1)));
    this.momo[0] = y;

    StandardMomentum[0] = y;

    ************************************************** ************************************************** *****************************************

    This is the only code where SMA is called.

    Here are the directives:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    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;
    using NinjaTrader.NinjaScript.Indicators;
    using NinjaTrader.NinjaScript.DrawingTools;​


    SMA also is not being called in either the Public Class or Configuration sections...

    #2
    Not sure what you mean by test script. The issue here is that I cannot export the strategy and special indicator used with the ninjascript export feature. I would need to send you the files directly. If that's what you need, please provide email address to send it to...

    Again, all works and compiles just fine. Just can't export it.

    Comment


      #3
      Hi Brandon, checking in... File sent to support via email yesterday... No response so far...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X