Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Knowing the new coordinates of a chart object that has been repositioned

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

    Knowing the new coordinates of a chart object that has been repositioned

    Hello, appreciated community.

    I would like to know if someone can guide me on the most practical way in which I can know, from a strategy that I am developing in NT8, the new coordinates (meaning, the price and the candle number or candle time, of the two anchor points) of a “ray” object that has been moved on the chart by the user.

    Currently, my strategy allows, through a button that I have previously programmed (and that is displayed on the chart), to plot rays, which can be changed position by the user, in a real time execution. When the user modifies the location (or inclination) of a ray, the strategy must update the two anchor points: (x1, y1) and (x2, y2), where “x” is the candlestick number or candlestick time, and “y” is the price. This coordinate information (along with the label assigned to each ray) are recorded in a list.

    I was looking in the online help, if there was some event like the one that is called when an order is modified (OnOrderUpdate), that is fired when there has been a change in some chart plotted object (something like “OnChartUpdate” or similar), but I haven't found anything.

    I believe that there should be a practical way that does not require the use of events such as “marketDataUpdate”, which impact the performance, to determine which ray was modified by the user, and then update the coordinates of that ray, in the aforementioned list.

    Thank you for your response and guidance.
    Best regards.​​​

    #2
    Hello Dennys Vera,

    There is not a way to get an update about that in the strategy, there are no events when drawing objects are updated. You would have to continuously check the objects values if you need them in your code.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    49 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X