Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing workspace

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

    Changing workspace

    Is it possible, from within a strategy, to change the active workspace?

    I have multiple workspaces open and, when certain conditions are met, I want to have the workspace in which those conditions were met to be immediately visible rather than having to manually navigate to that workspace.

    #2
    Unfortunately a strategy cannot change workspaces.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Another question

      Thanks, Josh, for the answer.

      Another, unrelated question. In the strategy wizard, one can set a user-defined variable. Is this variable "persistent"? The next time the system calls the strategy subroutine (I assume it's a subroutine), will that variable still have the same value I assigned it the last time the subroutine was called?

      Sorry - this question probably stems from my ignorance of C. I've coded for many years, but don't know C at all.

      Comment


        #4
        No, it will only persist for the given instance of the strategy. If you stop it its gone.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          How can I do this?

          OK, thanks.

          How, then, can I set a flag that can be accessed, read every time the strategy is called?

          The strategy I'm attempting to complete calls for (1) an MA crossover and (2) a bar to form completely below (or above) the shorter-term MA. No problem with determining this when it first occurs (I just look back at the previous bar on the open of the new bar), but the strategy needs to "know" that it occurred in the past, even if 30 bars ago. I could probably loop through each time and see if this condition did occur, but that seems unnecessarily resource intensive. Hope this makes sense.

          Comment


            #6
            You cannot make anything that persists through different instances of the strategy from the Wizard. If you wanted to do something like that you will have to use some fancier self programming.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              That's fine with me

              Are you willing to show me/tell me how it can be done? Or perhaps point me in a direction where I can learn how it can be done? About time I learned some C, anyhow.

              Comment


                #8
                Please see these references for some ideas: http://www.ninjatrader-support2.com/...ead.php?t=3475

                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Will do

                  Thanks, Josh.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by charlesugo_1, 05-26-2026, 05:03 PM
                  0 responses
                  65 views
                  0 likes
                  Last Post charlesugo_1  
                  Started by DannyP96, 05-18-2026, 02:38 PM
                  1 response
                  149 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 05-11-2026, 05:56 AM
                  0 responses
                  162 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CarlTrading, 05-10-2026, 08:12 PM
                  0 responses
                  99 views
                  0 likes
                  Last Post CarlTrading  
                  Started by Hwop38, 05-04-2026, 07:02 PM
                  0 responses
                  286 views
                  0 likes
                  Last Post Hwop38
                  by Hwop38
                   
                  Working...
                  X