• 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

MoveAnchorX

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

    MoveAnchorX

    I have created a Drawing Tool that draws a Rectangle that snaps to the High and Low of the selected bars within the Rectangle. Then I coded a polygon to draw the Volume Profile of the bars within the Rectangle. That works fine.

    Now I an attempting to move the vertical lines of the rectangle to the outside edge of the bar as opposed to NT default drawing them in the middle of the bar. I have uploaded an image for a visual.

    The latest attempt at this is:
    PHP Code:
    //MyAnchor.MoveAnchorX(lastPoint, newPoint, chartControl, chartScale);

    double barPixelWidth chartControl.GetBarPaintWidth(chartControl.BarsArray[0]);    
        
    NinjaTrader.Code.Output.Process(string.Format("barPixelWidth {0}  "barPixelWidth ), PrintTo.OutputTab1);    

    Point lastPoint StartAnchor.GetPoint(chartControlchartPanelchartScale) ;
        
    NinjaTrader.Code.Output.Process(string.Format("lastPoint {0}  "lastPoint ), PrintTo.OutputTab1);    

    double newX lastPoint.barPixelWidth;
        
    NinjaTrader.Code.Output.Process(string.Format("newX {0}  "newX ), PrintTo.OutputTab1);

    Point deltaPoint = new Point(newXlastPoint.Y);
        
    NinjaTrader.Code.Output.Process(string.Format("lastPoint {0}   deltaPoint {1}"lastPointdeltaPoint ), PrintTo.OutputTab1);

    StartAnchor.MoveAnchorXlastPoint,  deltaPointchartControlchartScale); 
    The OutputWindow shows;
    PHP Code:
    barPixelWidth 25  
    lastPoint 262.5
    ,782.5  
    newX 237.5  
    lastPoint 262.5
    ,782.5   deltaPoint 237.5,782.5 
    The StartAnchor DOES NOT move. What am I doing wrong? Suggestions?
    Thanks.
    Attached Files

    #2
    Hello TAJTrades,

    Thank you for reporting there may be an issue with the MoveAnchorX() method from anchors.

    I will test modifying this and if I am able to reproduce I will submit a report to our development.

    I appreciate your patience while I test.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Is there any update on this. I am still wondering if it is a "Me Issue" with the way I tried to code it or if it is something within NT?

      Comment


        #4
        Hello TAJTrades,

        We are still looking into this on our end.

        We will follow up with you when we have any details on this matter.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Hello TAJTrades,

          I am unable to reproduce the behavior.

          So I've copied and isolated the Line drawing tool in separate file to test this.

          In the OnMouseMove of the End anchor, I'm moving the StartAnchor with MoveAnchorX back and forth 50 pixels, and this appears to be working without any issue.

          Video of the test:
          https://www.screencast.com/t/xgejb0X3TfGR

          Script tested attached.
          Attached Files
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Thanks Chelsea.

            Now I know where the issue is. Me. I will rework the code again to see if I can get the rectangles vertical line to move off the bar center

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by yukashg, Yesterday, 09:56 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by cutzpr, Yesterday, 09:19 PM
            0 responses
            6 views
            0 likes
            Last Post cutzpr
            by cutzpr
             
            Started by nestorjt23, Yesterday, 08:55 PM
            3 responses
            18 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by 7robert, Yesterday, 08:30 PM
            1 response
            12 views
            0 likes
            Last Post 7robert
            by 7robert
             
            Started by mav8rick, Yesterday, 07:46 PM
            0 responses
            7 views
            0 likes
            Last Post mav8rick  
            Working...
            X