Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close trade outside of strategy

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

    Close trade outside of strategy

    Hi

    When running a strategy it is possible to open a SuperDom on the same underlying and watch the bid/ask/profit and stoploss/takeprofit points. This is great.

    However if I override the strategy by (say) closing the trade using the close button on the SuperDom the strategy is stopped and has to be restarted.

    Is it possible to override this behaviour so the strategy does not get stopped ?

    thanks for any help

    Dave

    #2
    Hello Downhillryder,

    You can middle mouse click the Close button in the SuperDOM to close any open or pending positions without disabling the strategy.

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi

      Thanks for the fast reply.

      When I middle click the close button I get a message asking me to select a strategy to close. What do I select ?

      To be clear, my original question pertained to a Strategy (NOT an ATM strategy) running with an open position that I want to close from the SuperDom. I want to close the position not the strategy, without closing the strategy, which is what happens when I left click the close button.

      Hope I am not being stupid here !!!

      regards

      Comment


        #4
        Hello Downhillryder,

        Thanks for clarifying that.

        You can manually place an opposing order to close the position. For example if you are short 1, you could place a buy market to become flat, although the strategy will still be running it is going to be unaware of this activity on the account so it will still think it is 1 short.

        By left clicking Close button it will close the current position, cancel any working orders, and disable any strategies applied to that instrument. If your strategy uses ATM Strategies then it would be possible to use the middle mouse button on the Close button to keep it enabled.

        Let us know if we can be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_JC View Post
          Hello Downhillryder,

          You can middle mouse click the Close button in the SuperDOM to close any open or pending positions without disabling the strategy.

          Let us know if we can be of further assistance.
          Is there a way to programatically do this in indicator? I am really having trouble closing a position taken by ninjascript strategy by using the close button of the chart trader.

          Comment


            #6
            Which issues are you seeing exactly Edward? Triggering the Close algorithm (with left mouse button) would disable running strategies on that instrument / account and attempt to cancel orders and close open positions.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Which issues are you seeing exactly Edward? Triggering the Close algorithm (with left mouse button) would disable running strategies on that instrument / account and attempt to cancel orders and close open positions.
              I really want to know the code for triggering the close algorithm(with middle mouse button) so that it will close the running strategies. I know that the using left mouse button will be this code

              Button mybutton = new Button();
              mybutton = (Button) ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["btnClose"];
              SendMessage(mybutton.Handle, WM_LBUTTONDOWN,(IntPtr)0,(IntPtr)0);
              SendMessage(mybutton.Handle, WM_LBUTTONUP,(IntPtr)0,(IntPtr)0);

              now what I want to know is the middle mouse button.

              Comment


                #8
                Edward, I could unfortunately not point to a supported / documented method call for that, however for the one you posted, there's a WM_MBUTTONDOWN / UP as well for the MS Winproc function.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

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