Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

'ArgumentException Error on Compiling

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

    'ArgumentException Error on Compiling

    Hello,

    I tried to compile my code and i got this error: The type or namespace name 'ArgumentException' could not be found (are you missing a using directive or an assembly reference?).

    I added below namespaces

    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.Design;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Drawing.Design;
    using System.Drawing.Drawing2D;
    using System.Windows.Forms;
    using System.ComponentModel;
    using System.Runtime.InteropServices;
    using System.Reflection;
    using System.Xml.Serialization;
    using System.Globalization;
    using System.IO;
    using System.Runtime.Serialization;
    using System.Diagnostics;
    using System.Threading;

    #2
    Hello,

    This error generally happens when you reference something that does not exist.

    Do you have any code that mentions ArgumentException?

    May I see that line of code?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      this Error comes from below but it's NT Generated Code.


      // This namespace holds all strategies and is required. Do not change it.
      namespace NinjaTrader.Strategy
      {
      public partial class Strategy : StrategyBase
      {
      /// <summary>
      /// kTrend Pivots
      /// </summary>
      /// <returns></returns>
      [Gui.Design.WizardCondition("Indicator")]
      public Indicator.kTrendPivots kTrendPivots()
      {
      return _indicator.kTrendPivots(Input);
      }

      /// <summary>
      /// kTrend Pivots
      /// </summary>
      /// <returns></returns>
      public Indicator.kTrendPivots kTrendPivots(Data.IDataSeries input)
      {
      if (InInitialize && input == null)
      throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

      return _indicator.kTrendPivots(input);
      }
      }
      }
      #endregion

      Comment


        #4
        Hello kalpesh2804,

        May I have an export of this strategy to test?

        To export your script do the following:
        1. Click File -> Utilities -> Export NinjaScript
        2. Enter a unique name for the file in the value for 'File name:'
        3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
        4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


        Below is a link to the help guide on Exporting NinjaScripts.
        http://www.ninjatrader.com/support/h...nt7/export.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Due to Error in Script. i am not able to export the script.

          thanks

          Comment


            #6
            Hi kalpesh2804,

            If possible, try to comment out the lines that are causing the compile error and then try to compile again.

            If you are not able to, you can send the cs files instead.

            An export will insure that all dependency files such as indicators will accompany so I may compile the script without error.

            If you are not able to comment out send all involved scripts.

            Strategies will be in the following location:
            • (My) Documents\NinjaTrader 7\bin\Custom\Strategy


            Indicators will be here:
            • (My) Documents\NinjaTrader 7\bin\Custom\Indicator


            Also, if you would like to keep your code private you can send the files to support[at]ninjatrader[dot]com. Write Attn: Chelsea #347148 and add a link to this forum thread to the body of your email.

            I look forward to receiving the files.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mongo, Today, 11:05 AM
            2 responses
            7 views
            0 likes
            Last Post Mongo
            by Mongo
             
            Started by guillembm, Today, 11:25 AM
            0 responses
            3 views
            0 likes
            Last Post guillembm  
            Started by Tim-c, Today, 10:58 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by traderqz, Yesterday, 09:06 AM
            4 responses
            27 views
            0 likes
            Last Post traderqz  
            Started by traderqz, Today, 12:06 AM
            4 responses
            8 views
            0 likes
            Last Post traderqz  
            Working...
            X