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

Compilation error

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

    Compilation error

    After editing a strategy named "FibSound1" I clicked on Finish button then I got "Error on generating Strategy". Under the code, I found this diagnosis :
    Description : The namespace 'NinjaTrader.Indicator' already contains a definition for 'DepthReferenceSample'
    File : DepthReferenceSample.cs Line : 19 Column : 18

    Here are the first lines of my code :

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Strategy;
    #endregion

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    /// <summary>
    /// Sounds Fibonacci retracements
    /// </summary>
    [Description("Sounds Fibonacci retracements")]
    [Gui.Design.DisplayName("FibSound1")]
    public class FibSound1 : Strategy

    I went back to Edit and deleted the DepthReferenceSample (that you recently uploaded on this forum). I renewed the compilation and it went right.
    I've had this very problem several times before and I did not put it on the forum because I was not sure whether I had imported the DepthReferenceSample properly; but now DepthReference indicator works on my chart and I am sure the problem comes from the compilation process.

    #2
    >> The namespace 'NinjaTrader.Indicator' already contains a definition for 'DepthReferenceSample'
    Means: there are two different files holding 2 classes with the same name: 'DepthReferenceSample'

    Comment


      #3
      I've cleaned up my directories and compilation works fine, thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by benmarkal, Yesterday, 12:52 PM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by helpwanted, Today, 03:06 AM
      1 response
      20 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Working...
      X