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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        154 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        306 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        244 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        345 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        176 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X