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

marketDataUpdate.IsReset ?

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

    marketDataUpdate.IsReset ?

    I read the help about IsReset but it only says something about UI needing to be updated. I don't particularily understand what that means.

    All code I could find in built-in .cs of NT8 looks like this:

    protected override void OnMarketData(Data.MarketDataEventArgs marketDataUpdate)
    {
    if (marketDataUpdate.IsReset)
    CurrentValue = double.MinValue;


    always setting to double.MinValue

    so is this just to signify that there is no data currently and to alert the user that the values are "not fresh" ?

    I'm trying to solve a problem where I sometimes need to hit F5 to refresh my custom columns... perhaps all columns in that market analyzer window - might be related to disconnects, not sure but likely.

    Could adding code to handle IsReset work?

    or can I just ignore checking IsReset ?

    #2
    I am not seeing the new micros in my Instrument Manager list...suggestions? NT 7
    thanks

    Comment


      #3
      Hello NinjaCustomer,

      This is used for Market Analyzer columns after disconnecting and reconnecting.

      What kind of script are you making?

      Are you finding the UI is not updating in the Market Analyzer when reconnecting?
      https://ninjatrader.com/support/help...aeventargs.htm
      Last edited by NinjaTrader_ChelseaB; 05-06-2019, 09:14 AM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        it is a non-data series accessing IsDataSeriesRequired = false;

        it displays some statistics it reads from static global variables that are populated from my strategy

        I am not sure because I haven't tried this yet as market was closed on the weekend so i couldn't try out IsReset

        I understand it is used for after disconnect and reconnect. but what does it do? it is just meant to visually show the user that the data is "not fresh" by setting it a min double value?

        Comment


          #5
          i think i understand now... since market data comes in at different times, you can use IsReset to clear any state variables you've been keeping

          Comment


            #6
            Hello NinjaCustomer,

            The IsReset does not apply to strategies.

            This only applies to columns that need the UI to update.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              yes, questions in this thread are about MarketAnalyzer columns

              Comment


                #8
                Hello NinjaCustomer,

                You have mentioned:
                "it displays some statistics it reads from static global variables that are populated from my strategy"

                Is this no longer the case?
                Are you no longer creating a NinjaScript Strategy?

                Are you finding the UI is not updating after changing the value from OnMarketData in a MarketAnalyzerColumn script?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  the mention about the strategy was just in response to "What kind of script are you making?" - I took that to mean what did the MarketAnalyzerColumn do.. so yes I am making a Strategy as well as MarketAnalyzerColumns.

                  But I'm not trying to use IsReset inside of a Strategy, I understand that they are only meant for use with MarketAnalyzerColumns.

                  I am finding that yes, the values do update. However... sometimes they need an F5 kickstart.. then they start to update and continue to update.

                  I will look at the code further, I was just wondering if this was some known type of behaviour, but I guess it is not.

                  Comment


                    #10
                    Hello NinjaCustomer,

                    I am not able to reproduce this with a simple test script after disconnecting and reconnecting.

                    In OnMarketData I'm just setting the value to the current time (to ensure its changing) and this appears to start updating immediately after connecting.

                    If you test this script in a new market analyzer (without any other custom columns) are you finding the test script is not updating after reconnecting?
                    Attached Files
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      yes I will need to pay attention and scrutinize the code more... I have other market analyzer columns I've created (other classes) and they don't do this.

                      Comment


                        #12
                        Hello NinjaCustomer,

                        As a tip, when marketDataUpdate.IsReset is true you can reset CurrentValue (or in specific scenarios CurrentText) to 0 or a blank value.
                        This property is used to prevent 'stale' values from appearing.
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Gerik, Today, 09:40 AM
                        2 responses
                        7 views
                        0 likes
                        Last Post Gerik
                        by Gerik
                         
                        Started by RookieTrader, Today, 09:37 AM
                        2 responses
                        11 views
                        0 likes
                        Last Post RookieTrader  
                        Started by alifarahani, Today, 09:40 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by KennyK, 05-29-2017, 02:02 AM
                        3 responses
                        1,285 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Started by AttiM, 02-14-2024, 05:20 PM
                        11 responses
                        186 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Working...
                        X