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

Save and load custom Series

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

    Save and load custom Series


    I want to know if there is a way to save and load custom indicator's series data.

    I developed a cusotm indicator that calculates a derivative value based on tick data, using OnMarketData(MarketDataEventArgs e). It's got a Series that is drawn continuously upon incoming tick data, based on the moment-to-moment bid/ask values. Upon refresh and reloading, this historical series data that was calculated is gone, since tick data isn't saved.

    I want to save the this calculated historical data series, eg. to a flat file or db, and load it (eg. in OnBarUpdate() method) when chart is reloaded with historical data.

    How could this be done? Is there a code example you can share for reference?

    Just to clarify I want to save the calculated Series in the form of completed bars (OHLC), not moment to moment marketEvent.

    Thanks.
    Last edited by yubo27; 12-06-2018, 04:23 PM.

    #2
    Hello yubo27,

    Thank you for the question.

    I noted that we received this message in our support email as well, I have copied my reply from your email for the community if any other members have other suggestions I am sure they will reply as well.

    This would not necessarily be something that we have a specific sample for but you could certainly do this. What you are asking about would require you to save and load data to file which are things you can do in general C#.

    We do have some general guides on writing data to file and reading data from file, you could likely implement something similar to save and load the indicator values as it processes.

    https://ninjatrader.com/support/help...o_write_to.htm

    https://ninjatrader.com/support/help...o_read_fro.htm

    Doing many file reads/writes is very inefficient so this is also something you would likely need to work on for it to not make the chart "pause" while your data is loaded or saved. The platform its self has no specific way to save your custom series data so this will be something you will have to build.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      hey everybody, I have the same problem, the indicator has so many Data to calculate, that it becomes very slowly. it becomes that slowly, that it isnt possible to calculate 20 days of 1 minute. How is this poblem be solved at NT or C#?

      may anybody give me an advice? thanks in advance.

      Comment


        #4
        Hello sane1111,

        It looks like your question is not related to this post. I would suggest making a new post for any specific questions you have about your custom code. All indicators are programmed different so we really couldn't say why it may be slow to load without more details on what you made. Generally the answer to this type of question is going to be that you need to debug your code to find out what part is causing it to be slow. Once you know that we could provide more specific answers or solutions if there are any. Your code needs to be efficient when making scripts so if you are doing a lot of extra work or a lot of drawing that can end up causing slow downs in initial processing.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        6 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        6 views
        0 likes
        Last Post quantismo  
        Started by AttiM, 02-14-2024, 05:20 PM
        8 responses
        167 views
        0 likes
        Last Post jeronymite  
        Started by cre8able, Today, 04:22 PM
        0 responses
        8 views
        0 likes
        Last Post cre8able  
        Started by RichStudent, Today, 04:21 PM
        0 responses
        5 views
        0 likes
        Last Post RichStudent  
        Working...
        X