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 NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X