Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HorizontalLine creation

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

    HorizontalLine creation

    Hi,

    I have an indicator with a button on the chart (System.Windows.Controls.Button). When I click the button -> a HorizontalLine appears (NinjaTrader.NinjaScript.DrawingTools.HorizontalLi ne). However, it appears not instantly, it appears when I scroll the chart (or with a first new tick).

    How to make the line appear instantly, without delays and additional actions with the chart?

    #2
    Hello, thanks for writing in. We have an example here showing how to get around the refresh limitation, the script should call ForceRefresh() after drawing the object:

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hello, thanks for writing in. We have an example here showing how to get around the refresh limitation, the script should call ForceRefresh() after drawing the object:
      https://forum.ninjatrader.com/forum/...lem#post792624
      Actually, the 'ForceRefresh()' does not help.

      Comment


        #4
        Hi, The ForceRefresh() will be the only thing you could use that would trigger the OnRender method to run again, otherwise you would need to move the chart manually. In the example I posted this works to force OnRender() to be called again.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        239 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        155 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        164 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        247 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        199 views
        0 likes
        Last Post CarlTrading  
        Working...
        X