Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it advised to insert buttons in DataLoaded instead of Historical

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

    Is it advised to insert buttons in DataLoaded instead of Historical

    the exmaple shows:


    that buttons are inserted in Historical. However, I'm interested if it's recommended way also, to insert them in "DataLoaded" state?

    what are cons?

    #2
    Hello TazoTodua,

    Thank you for the post.

    When comparing these states in regard to custom code, there are no suggestions from the help guide in regard to which may be better for this use. I would also not really have a specific suggestion here as both of these states are nearly identical, but they do serve their individual purpose through the scripts timeline.

    You can read their descriptions on the following page.


    As noted, the Historical state is called once the script actually starts processing historical data whereas DataLoaded is called immediately after all data has been loaded.These steps are one after the other so in reality, I dont think it would make much of a difference loading wise where you put this syntax between these two methods.

    Generally, I suggest following what we document in the help guide as that was tested but I do see that running this code works from OnDataLoaded as well. Because this is not a specific NijnaScript method such as AddDataSeries that is locked to a specific state I dont really see any problems that could arise. As always I do suggest testing any changes that deviate from help guide samples in all scenarios the script will be used.

    I look forward to being of further assistance.

    Comment


      #3
      thanks excellent answer

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X