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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X