Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Cache data

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

    Cache data

    Hi Jesse / NT Staff!

    I reviewed the details here and it sounds like I am trying to do something similar... Has there been any updates or changes to the ability to have a more global cached variables?

    In my case we call a process in the State.DataLoaded or State.Configred that is references an API call to an external server and consumes a pretty large amount of data (but when executed for the same instrument within an 8 hour period for example) the data would be the exact same each time. So, as an example when running strategy analyzer or optimization... This might get called thousands of times when we simply need it once for a period of time.

    I tried to add the standard .NET caching for memory cache but since this cached object is initialized in the indicator itself its not actually storing... I could possibly store a file on the server and access that file, which I think would likely be much faster than an API call... however I would really prefer not to have a bunch of temp files hanging around.

    Any ideas? A simple key/value ability in a NT controller for this?

    Thanks,

    Chad

    Last edited by NinjaTrader_PatrickG; 07-06-2021, 06:24 AM. Reason: Removed external link
    chadnash
    NinjaTrader Ecosystem Vendor - Nash Technologies

    #2
    Hello, thanks for your post.

    I have moved this post to its own thread since the reference thread was quite old. Here is the reference thread:

    https://ninjatrader.com/support/foru...dicators-cache

    There's nothing built into NinjaTrader that would support custom data caching. The lifecycle of the indicator object would not lend itself to internal objects within the indicator class for long term data storage. The data would need to be stored in a file on the local hard drive. It would also need to be determined if the file is different from the API data source at any given time. Unfortunately, this does go outside of the scope of support I able to provide, and I have no example that demonstrates. I can confirm that NinjaScript does not have any such thing built-in and it would need to be made custom from the ground up.

    Best regards,

    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris!

      -Chad
      chadnash
      NinjaTrader Ecosystem Vendor - Nash Technologies

      Comment


        #4
        BTW I am here in Denver and as things calm down from Covid (someday ) I am looking forward to meeting up with the team and grabbing some beers or dinner on me!

        -Chad
        chadnash
        NinjaTrader Ecosystem Vendor - Nash Technologies

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by MarianApalaghiei, Today, 10:49 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        8 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        46 views
        0 likes
        Last Post bill2023  
        Working...
        X