Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IDrawingTool....and information about line

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

    IDrawingTool....and information about line

    hi,
    i want to know information about line drawed in the chart..

    [CODE][
    I draw line with : Draw.Line(this, "mtUpHigh" + (MT.Count - 1), false, Low[3].Duration, mthigh, 0, mthigh, Brushes.LimeGreen, DashStyleHelper.Dash, 1);


    /CODE]


    I want to question this line

    i write :


    DrawingTools.Line tmp =DrawLine(this, "mtUpHigh" + (MT.Count - 1), false, Low[3].Duration, mthigh, 0, mthigh, Brushes.LimeGreen, DashStyleHelper.Dash, 1);
    i want information about : High (start point) and low price(end point) of line, about bars ago (start point ) and bard ago(end point)...

    how i can do it?

    thanks

    #2
    Hello turbofib,

    Thank you for your post.

    You would use Anchors to do this. Refer to our documentation at the following link: http://ninjatrader.com/support/helpG...us/anchors.htm
    You can also refer to the details in the thread at the following link: http://ninjatrader.com/support/forum...d.php?p=449692

    Please let me know if you have any questions.

    Comment


      #3
      hi,there are few example in the forum ..
      I want to plot this line in the screen



      (i want to change parameter High and Low of the Line in the update)

      i need 2 point not 3..

      in you page :



      //defines the chart anchors used for the drawing tool
      public ChartAnchor StartAnchor { get; set; }
      public ChartAnchor MiddleAnchor { get; set; }
      public ChartAnchor EndAnchor { get; set; }

      public override IEnumerable<ChartAnchor> Anchors
      {
      get
      {
      return new[] { StartAnchor, MiddleAnchor, EndAnchor };
      }
      }



      It defines 3 point..not 2..

      I define only StartAnchor and EndANchor? (two point)

      -Other question :

      to use DrawLine..i do it in void OnRender(ChartControl chartControl, ChartScale chartScale)
      or in OnBarUpdate() method?

      - I dont find the sintax of script to draw the line with anchor..Can you give me an example?

      Thanks
      Last edited by turbofib; 02-24-2016, 03:13 AM.

      Comment


        #4
        i try the example in help guide :

        publicChartAnchor StartAnchor { get; set; }
        publicChartAnchor MiddleAnchor { get; set; }
        publicChartAnchor EndAnchor { get; set; }

        protectedoverridevoid OnStateChange()
        {
        StartAnchor.DisplayName = "My Start Anchor";
        MiddleAnchor.DisplayName = "My Middle Anchor";
        EndAnchor.DisplayName = "My End Anchor";
        }

        publicoverrideIEnumerable<ChartAnchor> Anchors
        {
        get
        {
        returnnew[] { StartAnchor, MiddleAnchor, EndAnchor };
        }
        }
        publicoverridevoid OnRender(ChartControl chartControl, ChartScale chartScale)
        {
        foreach (ChartAnchor anchor in Anchors)
        {
        Print(anchor.DisplayName);
        }
        }

        [/QUOTE]

        (it not a version complete because i'v problem to write all in this space)
        (I have attached the full version)
        there is 2 error :
        Attached Files
        Last edited by turbofib; 02-24-2016, 08:26 AM.

        Comment


          #5
          turbofib,

          You would DrawLine in OnBarUpdate for these purposes. You would not need to supply an Anchor but if you want to change the points after drawing them then you would loop through all objects and pull the anchors and change them.

          So let's start from the beginning here. Is the object you wish to change the values of drawn from your script? Can you provide your script if so?

          Comment


            #6
            hi Patrick...i give you an exampe (is example with no sense...i know


            if low[0]<low[10]
            {
            Line ff=Draw.Line(this, "mtUpHigh" + CurrentBar, false, 10, Low[10], 0, Low[0], Brushes.LimeGreen, DashStyleHelper.Dash, 1);
            drawline=true;
            }

            If (drawline && low[0]>low[5])

            ===> change Low[0] in ff

            Comment


              #7
              This would be easier just to resubmit the drawing object with the new value. For example:
              Code:
              if low[0]<low[10] 
              {
              Line ff=Draw.Line(this, "mtUpHigh" + CurrentBar, false, 10, Low[10], 0, Low[0], Brushes.LimeGreen, DashStyleHelper.Dash, 1);
              drawline=true;
              }
              
              If (drawline && low[0]>low[5])
              Line ff=Draw.Line(this, "mtUpHigh" + CurrentBar, false, 10, Low[10], 0, Low[0], Brushes.LimeGreen, DashStyleHelper.Dash, 1);

              Comment


                #8
                ok..i understand this...
                But if i want to get information about ths Line : CurrentBar and High Point in Line..

                how can i do it?

                Comment


                  #9
                  The items are available through the ILine object itself. Please refer to the documentation at the following link: http://ninjatrader.com/support/helpGuides/nt7/iline.htm

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  436 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X