Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

'StrategyAnalyzer' does not exist

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

    'StrategyAnalyzer' does not exist

    I am very puzzled by the error. I created an empty indicator and so far it is just auto generated code without me adding one line so far.

    The type or namespace name 'StrategyAnalyzer' does not exist in the namespace 'NinjaTrader.NinjaScript' (are you missing an assembly reference?) CS0234 6 31

    Below is the auto generated code after I created an indicator and immediately tried to compile. I tried to repair ninjatrader 8 but it didn't work. can anyone please help?

    =========================
    region Using declarations

    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.DrawingTools;

    #endregion




    //This namespace holds Indicators in this folder and is required. Do not change it.

    namespace NinjaTrader.NinjaScript.Indicators

    {

    public class LastHourTradeZone : Indicator

    {

    protected override void OnStateChange()

    {

    if (State == State.SetDefaults)

    {

    Description = @"Enter the description for your new custom Indicator here.";

    Name = "LastHourTradeZone";

    Calculate = Calculate.OnBarClose;

    IsOverlay = true;

    DisplayInDataBox = true;

    DrawOnPricePanel = true;

    DrawHorizontalGridLines = true;

    DrawVerticalGridLines = true;

    PaintPriceMarkers = true;

    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;

    //Disable this property if your indicator requires custom values that cumulate with each new market data event.

    //See Help Guide for additional information.

    IsSuspendedWhileInactive = true;

    }

    else if (State == State.Configure)

    {

    }

    }




    protected override void OnBarUpdate()

    {

    //Add your custom indicator logic here.

    }

    }

    }




    region NinjaScript generated code. Neither change nor remove.




    namespace NinjaTrader.NinjaScript.Indicators

    {

    public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase

    {

    private LastHourTradeZone[] cacheLastHourTradeZone;

    public LastHourTradeZone LastHourTradeZone()

    {

    return LastHourTradeZone(Input);

    }




    public LastHourTradeZone LastHourTradeZone(ISeries<double> input)

    {

    if (cacheLastHourTradeZone != null)

    for (int idx = 0; idx < cacheLastHourTradeZone.Length; idx++)

    if (cacheLastHourTradeZone[idx] != null && cacheLastHourTradeZone[idx].EqualsInput(input))

    return cacheLastHourTradeZone[idx];

    return CacheIndicator<LastHourTradeZone>(new LastHourTradeZone(), input, ref cacheLastHourTradeZone);

    }

    }

    }




    namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns

    {

    public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase

    {

    public Indicators.LastHourTradeZone LastHourTradeZone()

    {

    return indicator.LastHourTradeZone(Input);

    }




    public Indicators.LastHourTradeZone LastHourTradeZone(ISeries<double> input )

    {

    return indicator.LastHourTradeZone(input);

    }

    }

    }




    namespace NinjaTrader.NinjaScript.Strategies

    {

    public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase

    {

    public Indicators.LastHourTradeZone LastHourTradeZone()

    {

    return indicator.LastHourTradeZone(Input);

    }




    public Indicators.LastHourTradeZone LastHourTradeZone(ISeries<double> input )

    {

    return indicator.LastHourTradeZone(input);

    }

    }

    }




    #endregion
    Last edited by zehua; 08-28-2024, 09:57 PM.

    #2
    Hello zehua,

    Please check the filename listed in the error, is it this script? There is no code that has StrategyAnalyzer in this code so that should not be able to generate that error. The error may be coming from a different script that you have. If possible post a screenshot of the error.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello zehua,

      Please check the filename listed in the error, is it this script? There is no code that has StrategyAnalyzer in this code so that should not be able to generate that error. The error may be coming from a different script that you have. If possible post a screenshot of the error.
      Thank you! Yes I created another indicator using chatGPT and it imported StrategyAnalyzer and caused this issue. I did not realize that when I click compile, it will try to compile all files instead of just the current one.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      574 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X