Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing a rectangle

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

    #31
    Originally posted by NinjaTrader_PatrickH View Post
    Hello outsource,

    Thank you for your response.

    So we do not wish to draw rectangles until the condition if (pressure >= lpMax && volume > lvolSMA) is true?

    If this is true, we need to assign barCode and blackBox to 0 for example until the condition is true and the values are assigned. Then check if the values are zero before checking them in a condition for the strategy.

    For example:
    Code:
            #region Variables
    		private IntSeries barCode;
    		private DataSeries blackBox;
            #endregion
    
            protected override void Initialize()
            {
    			barCode = new IntSeries(this);
    			blackBox = new DataSeries(this);
            }
    
            protected override void OnBarUpdate()
            {
    			if (pressure >= lpMax && volume > lvolSMA)
    			{
    				IRectangle rectangle = DrawRectangle("Rec", false, 0, High[0], -10, Low[0], Color.Blue, Color.Blue, 3);
    				barCode.Set(1);
    				blackBox.Set(rectangle.EndY);
    			}
    			
    			else
    			{
    				barCode.Set(0);
    				blackBox.Set(0);
    			}
            }
    
            #region Properties
            [Browsable(false)]
            [XmlIgnore()]
            public IntSeries BarCode
            {
                get { return barCode; }
            }
    		[Browsable(false)]
            [XmlIgnore()]
            public DataSeries BlackBox
            {
                get { return blackBox; }
            }
            #endregion
    Ok,thank you,Patrick,

    how do i next call it via strategy?Can you please provide the code snippet?

    Thanks

    Comment


      #32
      Hi Patrcick,

      i`m unable to apply the changes you suggest.barCode.Set(0) is already applied to the climaxchurn bar.I get a lot of errors and i don`t understand why do we need barCode here at all

      Can you make this changes withing the code,so i can finally use it properly??
      Attached Files

      Comment


        #33
        Hello outsource,

        Thank you for your response.

        What happened to blackBox? If you change the code you are working on can you provide details?
        Can you provide the code with the attempted changes that do not compile?

        Comment


          #34
          I`ve deleted the file.

          Guys,i`ve been asking you to add a couple of line for three weeks!!!Maybe it`s the time we should quit?

          Comment


            #35
            Hello outsource,

            Thank you for your response.

            We cannot continue to troubleshoot your script that continues to be updated on your end or removed from your installation. In addition, we do not provide programming or debugging services.

            Please let me know if you have any questions.

            Comment


              #36
              Updated on my end??I`m just trying to put the snippets you post and to no avail.And every time i post, a clean out of you broken parts, code wit the request to fix it.

              Have a nice day!!!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              576 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X