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

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 ETFVoyageur, Today, 10:13 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post ETFVoyageur  
                  Started by guyonabuffalo, Today, 10:01 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post guyonabuffalo  
                  Started by cre8able, 05-09-2024, 09:15 PM
                  3 responses
                  21 views
                  0 likes
                  Last Post cre8able  
                  Started by jpeep, 08-16-2020, 08:31 AM
                  17 responses
                  502 views
                  0 likes
                  Last Post notenufftime  
                  Started by ETFVoyageur, 05-07-2024, 07:05 PM
                  15 responses
                  124 views
                  0 likes
                  Last Post ETFVoyageur  
                  Working...
                  X