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

Status of Indicator when Workspace out of focus

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

    Status of Indicator when Workspace out of focus

    Hi,

    I'm a bit confused about what is going on when a Workspace is put out of focus i.e. another Workspace is put in focus. I want to know what happens to the indicators on the out of focus Workspace.

    It looks to me that either the indicators stop running, or they only run at end of bar.

    In the attached picture I'm printing the bar time, State, and bar number. When the Workspace is in focus I'm getting a print tick-by-tick. Then at 19:20 I put another Workspace in focus and left if for 5 minutes. Then I brought the original Workspace back into focus at 19:26. Between 19:21 and 19:25 I'm only getting bar end prints, not the tick-by-tick prints. And the State is 'Realtime'

    1. Does the indicator completely stop running when the Workspace goes out of focus? Or does it run end-of-bar only, or something else?
    2. Is the indicator printing 19:21 to 19:25 when I bring it back into focus? Or when it's out of focus and it is running bar end only? In this case the State is 'Realtime' but it is effectively running historically. ?
    3. Is there a way for the indicator to detect that it is
    a) out of focus
    b) switched back into focus
    c) now processing 'historic' bars even though the State is 'Realtime'.

    Hope that makes sense. Please ask if I need to explain more.

    Thanks
    Attached Files

    #2
    Hello bubblegum,

    Within your indicators running on that workspace, you likley have IsSuspendedWhileInactive = true under State==SetDefaults.

    Please see IsSuspendedWhileInactive section of our helpguide and refer to the indicators running on that workspace to check that IsSuspendedWhileInactive is not set to true.



    Please let us know if this fails to resolve the issue.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      That solves my immediate issue. Thank you!

      What remains outstanding though is that when I get the focus back, and the indicator then processes the 'suspended' bars, it is processing historic bars, but the State of the indicator is 'Realtime'. I'm not sure if you want to class that as a 'bug' or 'by design', but regardless, how can I tell that these bars are being processed historically?

      Thanks

      Comment


        #4
        Hello bubblegum,

        When you set IsSuspendedWhileInactive = false, you are saying when you bring back the workspace which is out of focus, you experience this?

        To print the state you could use,

        Code:
        Print(State.ToString());
        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          No, I'm saying that 'IsSuspendedWhileInactive = false' works fine.

          My problem is that if I leave this setting to 'true' then when I come out of suspension it is processing historical bars (those bars there were not processed during the suspension but have to be processed now that we have come out of suspension), but that the State is 'Realtime'.

          Maybe another way to look at this is that there is a 'State' missing. We have 'Historical' and we have 'Realtime' but there is no 'Coming out of Suspension' state.

          Thanks

          Comment


            #6
            Hello Bubblegum,

            There is a state between real time and historical, that being State.Transition. Please see the following section of our helpguide.


            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              The Transition state is not relevant in this case.

              I've posted another picture. When the indicator comes out of Suspension, it is processing Historical bars, but if you use Print(State.ToString()) is says the bars are Realtime. This is incorrect.

              Can you pass this to your development team.

              Thanks
              Attached Files

              Comment


                #8
                Hello bubblegum,

                I will pass this on to development in the form of a feature request.

                Thank you.
                Last edited by NinjaTrader_AlanP; 05-10-2017, 11:25 AM.
                Alan P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sofortune, Yesterday, 11:48 AM
                2 responses
                23 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by Zach55, 02-19-2024, 07:22 PM
                2 responses
                57 views
                0 likes
                Last Post lbadisa1  
                Started by JGriff5646, Today, 05:47 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by AlphaOptions, 06-18-2013, 08:24 AM
                9 responses
                2,200 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by ttrader23, Today, 09:33 AM
                3 responses
                23 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X