Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Object

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

    Draw Object

    Hi i am using this high volume indicator
    I want to draw an Arrow after 5 minutes when volume of 1000 size comes
    regards

    HTML Code:
        public class HighVolAlert : Indicator
        {
            #region Variables
            // Wizard generated variables
               private int highVolume = 1000; // Default setting for HighVolume
    		  
    		private Color highAlert = Color.Black;
    		
            // User defined variables (add any user defined variables below)
            #endregion
    
            /// <summary>
            /// This method is used to configure the indicator and is called once before any bar data is loaded.
            /// </summary>
            protected override void Initialize()
            {
               
               // Add(new Plot(new Pen(Color.Blue, 2), PlotStyle.Bar, "Volume"));
    			//Add(new Line(Color.DarkGray, 0, "Zero line"));
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
                Value.Set(Volume[0]);
    		
                if (Volume[0] >= HighVolume)
    				
    			{
    				
    				DrawDiamond("VolDiamond" + CurrentBar,true, 0, High[0] + 40*TickSize, highAlert);
    				
    			}
    			
    			
            }
    
         

    #2
    Hello SLASH,

    Thank you for your post.

    Apply the indicator to a 5 Minute chart and replace the DrawDiamond() method with either the DrawArrowUp() or DrawArrowDown() method.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello SLASH,

      Thank you for your post.

      Apply the indicator to a 5 Minute chart and replace the DrawDiamond() method with either the DrawArrowUp() or DrawArrowDown() method.
      but how to draw arrow after 5 or say after 15 minutes?

      Comment


        #4
        Hello SLASH,

        Thank you for your response.

        So you are saying no matter the chart period and interval you apply the indicator to?

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello SLASH,

          Thank you for your response.

          So you are saying no matter the chart period and interval you apply the indicator to?
          ya it has nothing to do with chart period I can use 1 min chart and want to draw arrow after 15 minutes of the bar which has high vol
          regards

          Comment


            #6
            Hello SLASH,

            Thank you for your response.

            I believe you are asking how to wait a set number of minutes after your highVolume is reached before drawing the arrow. If this is the case we would use Time[0] and the DateTime.AddMinutes() method, please refer to the code below:
            Code:
                    #region Variables
                    // Wizard generated variables
                    private int highVolume = 1000; // Default setting for HighVolume
            		private DateTime timeHVol;
            		private int timeToWait = 15; // Default setting for timeToWait
            		  
            		private Color highAlert = Color.Black;
            		
                    // User defined variables (add any user defined variables below)
                    #endregion
            
                    /// <summary>
                    /// This method is used to configure the indicator and is called once before any bar data is loaded.
                    /// </summary>
                    protected override void Initialize()
                    {
                       
                       // Add(new Plot(new Pen(Color.Blue, 2), PlotStyle.Bar, "Volume"));
            			//Add(new Line(Color.DarkGray, 0, "Zero line"));
                    }
            
                    /// <summary>
                    /// Called on each bar update event (incoming tick)
                    /// </summary>
                    protected override void OnBarUpdate()
                    {
                        Value.Set(Volume[0]);
            		
                        if (Volume[0] >= highVolume)
            				
            			{
            				DrawDiamond("VolDiamond" + CurrentBar,true, 0, High[0] + 40*TickSize, highAlert);
            				timeHVol = Time[0];
            			}
            			
            			if(timeHVol.AddMinutes(timeToWait) <= Time[0])
            			{
            				// draw your arrow.
            			}
                    }
            
                    #region Properties
            		[Description("Number of minute to wait since HighVolume reached")]
            		[GridCategory("Parameters")]
            		public int TimeToWait
            		{
            			get { return timeToWait; }
            			set { timeToWait = Math.Max(1, value); }
            		}
                    #endregion
            For information on Time please visit the following link: http://www.ninjatrader.com/support/h...s/nt7/time.htm

            For information on .AddMinutes() please visit the following link: http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            577 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