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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        51 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        31 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        165 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        100 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        160 views
        2 likes
        Last Post CaptainJack  
        Working...
        X