Announcement

Collapse
No announcement yet.

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 NeverDownMoney, Today, 02:42 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by localappleseed, Today, 02:20 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by asmmbillah, Today, 02:48 PM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by KacemRhaz, Today, 01:31 PM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChristopherD  
            Started by ronaldgreene828, Today, 12:08 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Kate  
            Working...
            X