• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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
    Patrick H.NinjaTrader Customer Service

    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
        			}
        		}
        Patrick H.NinjaTrader Customer Service

        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.
            Patrick H.NinjaTrader Customer Service

            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.
                Patrick H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Tagliareni, Yesterday, 08:10 PM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by SDaCosta30, Today, 04:19 AM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by memonolog, Today, 02:39 AM
                3 responses
                21 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by memonolog, Today, 07:07 AM
                0 responses
                4 views
                0 likes
                Last Post memonolog  
                Started by juanram, Today, 06:01 AM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Working...
                X