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

Passing rectangle to Data Series

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

    Passing rectangle to Data Series

    Hello,Support and All!

    Could you please assist me to pass the rectangle to data series,so i can you use it with a strategy?

    I`m trying to pass it using IRectangle interface,but it seems like shooting the signals whenever it wants.Also,i cannot differentiate between the bullsih rectangle and bearish rectangle.It just uses the coloring to differentiate between the too.basically,what i need is the EndY for the bearish rectangle and StartY for the bullish one.Any assistance is appreciated.the indicator attached.

    Thank you!
    Attached Files

    #2
    Hello outsource,

    Thank you for your post.

    Is this your own indicator that you have built or a third party's?
    If this is your own, can you break the code down to just the items you are trying to work with? If this is a third party's indicator I would ask them for assistance on this matter.

    You can also look to our affiliate NinjaTrader Ecosystem's NinjaScript Consultant partners publicly available at the following link: http://ninjatraderecosystem.com/Part...ultants.php#81

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello outsource,

      Thank you for your post.

      Is this your own indicator that you have built or a third party's?
      If this is your own, can you break the code down to just the items you are trying to work with? If this is a third party's indicator I would ask them for assistance on this matter.

      You can also look to our affiliate NinjaTrader Ecosystem's NinjaScript Consultant partners publicly available at the following link: http://ninjatraderecosystem.com/Part...ultants.php#81
      I bought it,hence it`s my own.

      I`m trying to work with this part:

      private void drawTargetArea(string tag, int pos, double upper, double lower, Color color)
      {
      if(showTargetArea)
      {
      DrawRectangle(tag,false,pos+4,upper,pos-4,lower,Color.Transparent,color,patternOpacity);
      }
      }

      How do i pass the rectangle correctly for both bearish and bullish rectangles?

      Thank you

      Comment


        #4
        Hello outsource,

        Thank you for your response.

        Originally posted by outsource View Post
        How do i pass the rectangle correctly for both bearish and bullish rectangles?
        The method drawTargetArea pulls an upper and lower double value, base don your descriptions you would reverse these for short or long in the drawTargetarea method.

        For example:
        Code:
        		private void drawTargetArea(string tag, int pos, double upper, double lower, Color color)
        		{
        			if(showTargetArea)
        			{
        				if (Position.MarketPosition == MarketPosition.Long)
        					//Draw Long Rect
        				if (position.MarketPosition == MarketPosition.Short)
        					//Draw Short Rect
        			}
        		}

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello outsource,

          Thank you for your response.


          The method drawTargetArea pulls an upper and lower double value, base don your descriptions you would reverse these for short or long in the drawTargetarea method.

          For example:
          Code:
          		private void drawTargetArea(string tag, int pos, double upper, double lower, Color color)
          		{
          			if(showTargetArea)
          			{
          				if (Position.MarketPosition == MarketPosition.Long)
          					//Draw Long Rect
          				if (position.MarketPosition == MarketPosition.Short)
          					//Draw Short Rect
          			}
          		}
          Hi Patrick,

          i don`t understand anything from the snippet you provided.The question wa how do i expose the values to the data series so i can use them in a strategy.

          Comment


            #6
            Hello outsource,

            Thank you for your response.

            It would be best to simply assign a value to a Data Series or Plot when the rectangles are called - so when the conditions for bullish or bearish return true. You would need to familiarize yourself with the code or contact the developer of the code for further assistance.

            Please let me know if you have any questions.

            Comment


              #7
              I`m trying like:

              Variables

              private DataSeries myRectangleTargetL;
              private DataSeries myRectangleTargetS;

              Initialize

              myRectangleTargetL = new DataSeries(this);
              myRectangleTargetS = new DataSeries(this);

              Properties

              [Browsable(false)]
              [XmlIgnore()]
              public DataSeries RectangleTargetL
              {
              get { return myRectangleTargetL; }
              }

              [Browsable(false)]
              [XmlIgnore()]
              public DataSeries RectangleTargetS
              {
              get { return myRectangleTargetS; }
              }

              But how do i do it in the drawing region to hook up a strategy with?

              private void drawTargetArea(string tag, int pos, double upper, double lower, Color color)
              {
              if(showTargetArea)
              {
              DrawRectangle(tag,false,pos+4,upper,pos-,lower,Color.Transparent,color,patternOpacity);
              }
              }

              Would that be correct:
              {

              IDrawRectangle rectangle = DrawRectangle(tag,false,pos+4,upper,pos-,lower,Color.Transparent,color,patternOpacity);

              myRectangleTargetL.Set(rectangle.EndY);
              }

              Seems correct,but only for the bullish rectangle.How do i add the bearish rectangle?
              Last edited by outsource; 05-18-2016, 02:56 PM.

              Comment


                #8
                outsource,

                Please contact the developer of the code for assistance with their system.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                24 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                15 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                46 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                23 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X