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

manual intervention of live strategy

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

    manual intervention of live strategy

    Hi,

    what is the proper way is to manually intervene when a strategy is running and not affect the other strategies that are running.

    also, i run multiple strategies on the same instrument.

    lets say i stop a strategy. i'd like it to exit the position.
    when i restart the strategy, things sometimes get out of whack.
    It can display an unrealized p&l even tho no positions are on.

    Since there are other strategies running, i dont want to flatten all the positions.

    plz help

    #2
    Hi diffused, you can manually stop a running strategy by pressing the corresponding 'Stop' button in the Strategies tab - http://www.ninjatrader-support.com/H...tegiesTab.html

    The display of the unrealized PnL is expected, since this represents the historical position the strategy is in at the moment you restart it and put it into 'live' mode.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi diffused, you can manually stop a running strategy by pressing the corresponding 'Stop' button in the Strategies tab - http://www.ninjatrader-support.com/H...tegiesTab.html

      The display of the unrealized PnL is expected, since this represents the historical position the strategy is in at the moment you restart it and put it into 'live' mode.
      Hi Bertrand,

      yup the 'stop' strategy works well enough.

      what happens is that when i want to continue or add new strategies, the virtual position seems to get out of whack.

      I dont want to stop and flatten all positions when i've got about 5 other strategies all running.

      lets say i've got 2 strategies running on YM and ES.
      when i add another new strategy to the YM and click start, the strategy somehow obtains some random virtual position and shows it.

      Comment


        #4
        Do you have 'Wait until flat' set under Tools > Options > Strategies > NinjaScript?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Do you have 'Wait until flat' set under Tools > Options > Strategies > NinjaScript?
          heya, i've tried a combination of that and 'immediately submit' and both have some issues.

          it either starts with a running virtual position or it doesnt send any orders at all.

          i found this thing and it might be on the right track.


          i'm not clear on one thing from it tho.

          lets say i start a strategy and it immediately displays a long position.
          what exactly should i do then? submitting a close order stops the strategy.

          Comment


            #6
            If your strategy position is 1 long and your account position is flat, you need to buy one contract manually to bring both in sync, otherwise if you don't do that and your strategy exits the long, your account will be 1 short and thus you have to deal with a mismatch between the strategy position and the account position.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              If your strategy position is 1 long and your account position is flat, you need to buy one contract manually to bring both in sync, otherwise if you don't do that and your strategy exits the long, your account will be 1 short and thus you have to deal with a mismatch between the strategy position and the account position.
              ok, i've just bought 1 long. the strategy tab says 500 unrealized and the positions tabs says 124.

              the stop/take targets are there but the entry isnt right since i bought at market.

              is this expected behavior?

              Comment


                #8
                Correct, you normally won't get the same entry price as the strategy when syncing it up manually, important is that your account position matches your strategy position.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  Correct, you normally won't get the same entry price as the strategy when syncing it up manually, important is that your account position matches your strategy position.
                  ok, so what happens if i dont submit the market order?

                  if it hits my stop or target, will it be considered synced?

                  Comment


                    #10
                    If you don't synch the strategy properly and the stop or target are hit you'll end up with a unwanted position then. Consider this example, the strategy is 1 contract long and your account is flat because you don't submit a market order to synch the strategy position with the account position. Then your target is hit, which means the strategy issues a Sell order to get its strategy position flat, but transferred to your account this means you are short, which is not the desired result.

                    So in short, either choose the 'wait until flat' option if you start your strategy or take proper care to synch it up with your account position if you choose to 'immediately submit live working historical orders'.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Bertrand View Post
                      If you don't synch the strategy properly and the stop or target are hit you'll end up with a unwanted position then. Consider this example, the strategy is 1 contract long and your account is flat because you don't submit a market order to synch the strategy position with the account position. Then your target is hit, which means the strategy issues a Sell order to get its strategy position flat, but transferred to your account this means you are short, which is not the desired result.

                      So in short, either choose the 'wait until flat' option if you start your strategy or take proper care to synch it up with your account position if you choose to 'immediately submit live working historical orders'.
                      ok, thanks.

                      i'm currently working with the sim101 account. Does this behavior occur on a live account?

                      Comment


                        #12
                        Yes, the same process is present on a live account.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Bertrand View Post
                          Yes, the same process is present on a live account.
                          thanks again

                          now, sometimes i have the scenario where a strategy doesnt actually put on any trades or show an unsynced virtual position when starting.

                          the strategy does work under backtesting.

                          i also have confirmed that the signals it uses have fired off.

                          it's also on an instrument that isnt being used by any current strategy.

                          i've tried 'wait until flat' too.

                          Comment


                            #14
                            diffused,

                            Not sure why your strategy would submit to an instrument not used by your strategy. Orders will only go off to instruments stated by the strategy.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Josh View Post
                              diffused,

                              Not sure why your strategy would submit to an instrument not used by your strategy. Orders will only go off to instruments stated by the strategy.
                              sorry, that line i said was a bit confusing.

                              what i meant was: there wasnt any other strategy running on the instrument.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DustyContrer, Today, 04:02 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post DustyContrer  
                              Started by ETFVoyageur, Today, 02:15 AM
                              0 responses
                              11 views
                              0 likes
                              Last Post ETFVoyageur  
                              Started by Board game geek, Today, 01:34 AM
                              0 responses
                              9 views
                              0 likes
                              Last Post Board game geek  
                              Started by morrnel, 05-12-2024, 06:07 PM
                              3 responses
                              43 views
                              0 likes
                              Last Post wzgy0920  
                              Started by FishTrade, Yesterday, 11:11 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post FishTrade  
                              Working...
                              X