Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update indicator plot value OnMarketData()

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

    Update indicator plot value OnMarketData()

    Hi. I have an indicator value that is calculated on each OnMarketData() call. The plot is located in the OnBarUpdate() method and only seems to get updated whenever the last price moves in any one direction. This is not the desired result. Is it possible to have the indicator plot update whenever the OnMarketData() method is called? If I put the plot in the OnMarketData() method, only the close[0] dataseries is shown for the indicator value.

    Thanks.

    #2
    Tight Face, have you already tried setting the Indicator OnBarUpdate() to CalculateOnBarClose = false, this would trigger updates to the plotted value on each incoming tick then.

    Comment


      #3
      Yes I always have calculateonbarclose = false. I tried to lower the refresh rate to 0 in the chart properties, but that locked up the program. I set it to 0.01 and that seemed to do a better job at updating every tick.

      Comment


        #4
        You should never really be calling Plot(). Calling it directly can mess things up pretty badly due to race conditions.

        Instead you should call invalidate, which triggers Plot() to be called when it is ok to call. You do so something like the following:

        ChartControl.ChartPanel.Invalidate();

        Comment


          #5
          Sorry, I did not quite read your comments correctly. You are not calling Plot, but trying to set a plot value.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          236 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          150 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          162 views
          1 like
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          243 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          198 views
          0 likes
          Last Post CarlTrading  
          Working...
          X