Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Confused

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

    Confused

    This plots

    Code:
    	if(Low[0] == Close[0] &&  High[1] == Close[1]) 
    				  Plot0.Set(0);
    but this doesn't

    Code:
    	if(High[0] <= High[1] && Low[0] >= Low[1])	//Inside Bar type
    			
    			   Plot0.Set(0);
    <== doesn't compile so I am stuck!!

    #2
    If things don't compile, please provide the error list.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      error

      invalid expression term '='

      I have tried making the condition a true/false and then only plotting when true but this compiles but no plots.

      Comment


        #4
        full code

        Code:
           protected override void Initialize()
          {
        Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Dot, "Plot0"));
        Add (new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Dot, "Plot1"));
        
        			
        		
                    CalculateOnBarClose	= true;
                    Overlay				= false;
                    PriceTypeSupported	= false;
                }
        
        
                protected override void OnBarUpdate()
                {
        			
        int insidebar = 0;
        			
        		
        
        if(High[0] <= High[1] && Low[0] >= Low[1])	//Inside Bar
        	{insidebar = 1;}
        			
        if (insidebar > 0)
        				
          {Plot0.Set(1);	}
        			
        	
        
                }
        
                #region Properties
                [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                public DataSeries Plot0
                {
                    get { return Values[0]; }
                }
                [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                public DataSeries Plot1
                {
                    get { return Values[1]; }
                }

        Comment


          #5
          Originally posted by Mindset View Post
          Code:
             protected override void Initialize()
            {
          Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Dot, "Plot0"));
          Add (new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Dot, "Plot1"));
           
           
           
                      CalculateOnBarClose    = true;
                      Overlay                = false;
                      PriceTypeSupported    = false;
                  }
           
           
                  protected override void OnBarUpdate()
                  {
           
          int insidebar = 0;
           
           
           
          if(High[0] <= High[1] && Low[0] >= Low[1])    //Inside Bar
              {insidebar = 1;}
           
          if (insidebar > 0)
           
            {Plot0.Set(1);    }
           
           
           
                  }
           
                  #region Properties
                  [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                  [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                  public DataSeries Plot0
                  {
                      get { return Values[0]; }
                  }
                  [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                  [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                  public DataSeries Plot1
                  {
                      get { return Values[1]; }
                  }

          Mindset,

          Don't feel bad. We all made this same mistake.

          I wish NT would automatically build this into every chart!!!!!

          Sigh !!!!!!

          Insert the following "if" statement where shown.

          ----------------------------------------------------------
          protected override void OnBarUpdate()

          {

          if
          ( CurrentBar < 2) return;

          -----------------------------------------------------------

          RJay
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment


            #6
            Always check the LOG tab when things seem funny.
            mrlogik
            NinjaTrader Ecosystem Vendor - Purelogik Trading

            Comment


              #7
              can't believe that



              I spent an hour trying various things and that really is c# 101.
              thanks rt 6176

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              599 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              344 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              558 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              557 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X