• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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, 03: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

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Orden33, Today, 10:09 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by martyn73, Today, 10:18 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by silverm3170, Today, 10:03 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by diff24rac, 04-04-2018, 05:32 AM
    6 responses
    473 views
    0 likes
    Last Post fx.practic  
    Started by gma17, Today, 08:58 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X