Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ReloadAllHistoricalData();

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

    ReloadAllHistoricalData();

    One of the indicators I'm working on has a button which changes the secondary time frame that it runs off of. I've been using ReloadAllHistoricalData(); when the user wants to change the time frame on the fly and this works well enough but does have a few issues.

    Before trying to further isolate the issues I'm having, I'm wondering if there is simply a way to reload the Indicator via code (other than using a send key to press F5)

    If there isn't then have there been any reports of ReloadAllHistoricalData() not working 100% of the time? It seems as though it always works when I'm not connected to a data feed. When I am connected to a data feed it works most of the time but many times it does not. I've tested with prints and the print will trigger but the data never queues a reload.

    #2
    Originally posted by HandsFreeTrader View Post
    One of the indicators I'm working on has a button which changes the secondary time frame that it runs off of. I've been using ReloadAllHistoricalData(); when the user wants to change the time frame on the fly and this works well enough but does have a few issues.

    Before trying to further isolate the issues I'm having, I'm wondering if there is simply a way to reload the Indicator via code (other than using a send key to press F5)
    There is no recommended way to programmatically reload NinjaScript from NinjaScript, even if it is attempting to reload another NinjaScript file. Doing it through the UI via F5 or windows Automation is the only possible way, but still is not encouraged.

    Originally posted by HandsFreeTrader View Post
    If there isn't then have there been any reports of ReloadAllHistoricalData() not working 100% of the time? It seems as though it always works when I'm not connected to a data feed. When I am connected to a data feed it works most of the time but many times it does not. I've tested with prints and the print will trigger but the data never queues a reload.
    ReloadAllHistoricalData() was only designed to be called from OnConnectionStatus e.g., after a connection loss event. Its design is for reloading data that an indicator/strategy may not have been able to read since it was not connected to the internet. Reloading NinjaScript was not its purpose and we have some notes in the help guide to try and discourage repurposing it for other methods.



    We're sensitive to the fact that programmatically reloading NinjaScript is highly sought after and has been for awhile, but it introduces some unique challenges we still have not been able to over come at this point in NT8. Implementing a helper method in some sort of wrapper or extension to achieve what you're looking for, while also trying and handle some of the problems that could occur for the user is on our list to revisit once our development cycle slows down from bug fixing. I'll include this thread, including your need to reload NinjaScript after a user changes a secondary time frame from a button in our case notes.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by HandsFreeTrader View Post
      When I am connected to a data feed it works most of the time but many times it does not. I've tested with prints and the print will trigger but the data never queues a reload.
      If you do find a specific scenario where it does NOT work as expected, we will be happy to look at it. If you have a minimal viable script, you can send it into me directly at [email protected], or through our regular support channels.
      MatthewNinjaTrader Product Management

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ZenCortexCLICK, Today, 04:58 AM
      0 responses
      2 views
      0 likes
      Last Post ZenCortexCLICK  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      172 responses
      2,280 views
      0 likes
      Last Post sidlercom80  
      Started by Irukandji, Yesterday, 02:53 AM
      2 responses
      17 views
      0 likes
      Last Post Irukandji  
      Started by adeelshahzad, Today, 03:54 AM
      0 responses
      4 views
      0 likes
      Last Post adeelshahzad  
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X