Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Refresh

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

    Chart Refresh

    Hi,

    I saw from another post that if i need to refresh a chart, i could use the below 2 methods:

    1) The object being added and removed is only a step to cause the refresh, because the chart is looking for an object to be removed this would cause a refresh.

    The syntax could be as simple as the following:
    Code:
    Draw.Dot(this, "dummy_dot", false, 0, 0, Brushes.Transparent);
    RemoveDrawObject("dummy_dot");

    OR

    2) using ForceRefresh()
    ---------------------------------------------------------------------------

    Can I check if
    1) I have an active trade running on a strategy and I perform either of the above methods to refresh the chart, will it affect my active trade (meaning disable my strategy)?
    I asked because if I have an active trade running on a strategy and I manually clicked on the "Reload all historical data" to refresh the chart, it would prompt me that my strategy would be disabled.

    Thanks.

    #2
    Hello,
    Thanks for your post.

    You are correct. The OnRender() method frequently runs once the State has reached State.Realtime. There are several events that will cause OnRender() to be re-queued to run again. These events include:

    • OnBarUpdate() event
    • OnConnectionStatusUpdate() event
    • User clicks on the chart
    • Drawing object(s) have been removed from the chart
    • Strategy enabled/disabled on chart
    • ChartTrader enabled/disabled

    You may also use the ForceRefresh() method to re-queue OnRender() again. Although, it should be noted that if one of the above events has occurred since the last call to OnRender(), it would not be necessary to force a refresh. Forcing a refresh when it is not needed can impact your platforms performance, so please be mindful of that when using the ForceRefresh() method.

    Neither using ForceRefresh() or RemoveDrawObject() will cause your strategy to be disabled.

    I am including a link to our help guide documentation for ForceRefresh(), for your convenience.

    ForceRefresh()
    https://ninjatrader.com/support/help...rcerefresh.htm

    Please let me know if you have any further questions.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hi JoshG,

      Thanks for all the information.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      63 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      139 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X