• 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

Update Position of Manual Drawing

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

    Update Position of Manual Drawing

    I've drawn a textbox manually and I would like to update it's position via my strategy. Basically I want to be able to edit the text on the chart so I can pass commands to the strategy and have the position always be in the lower left hand corner.

    Should this be possible? How do I update the position? Here's what I'm trying so far:

    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    if(draw is DrawingTools.TextFixed)
    {
    TextFixed textFixed = draw as TextFixed;
    if(textFixed.Tag == "Command")
    {
    textFixed.Anchor.StartAnchor.Price = MIN(ChartBars.ToIndex - ChartBars.FromIndex)[0] - 1;
    }
    }
    }

    #2
    Hello calebsandfort,

    Draw.TextFixed objects are fixed. They don't use a price or time value they use TextPosition.BottomLeft, BottomRight, Center, TopLeft, TopRight.
    https://ninjatrader.com/support/help.../textfixed.htm

    You may be thinking of Draw.Text.
    https://ninjatrader.com/support/help...en-us/text.htm


    It is not currently possible to modify a drawing object's anchors BarsAgo or remove drawing objects that are not created by the script. It is possible to change the colors of drawing objects and sometimes other properties. However, I am unsure about specifically changing the price of Text objects anchor.

    I will further research and if I find this is not possible I will submit a feature request on your behalf for the development team to consider this for a future version of NinjaTrader.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes, Draw.Text is what I meant.

      Basically I'm just trying to figure out a way to communicate with my strategy while it is running. My first thought was a text field that I could pass commands thru.

      I also saw someone suggest using a text file in the NinjaTrader temp directory.

      Any other ways of doing this?

      Comment


        #4
        Hello calebsandfort,

        I am finding that the price can be changed when the script is in real-time data.

        Below is a link to a video and attached is the test script.
        https://drive.google.com/file/d/1nXS...w?usp=drivesdk

        Just a heads up, the DrawObjects collection may not be populated when the chart is processing historical data.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by PG7940, Today, 04:26 AM
        0 responses
        2 views
        0 likes
        Last Post PG7940
        by PG7940
         
        Started by marcus2300, Today, 02:25 AM
        0 responses
        2 views
        0 likes
        Last Post marcus2300  
        Started by drpapp, 01-24-2019, 06:57 AM
        5 responses
        69 views
        0 likes
        Last Post pjsmith
        by pjsmith
         
        Started by plydcv, Today, 12:40 AM
        0 responses
        3 views
        0 likes
        Last Post plydcv
        by plydcv
         
        Started by Sh00tHerMcGavin, Yesterday, 07:39 PM
        0 responses
        4 views
        0 likes
        Last Post Sh00tHerMcGavin  
        Working...
        X