Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Button "Close"

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

    Button "Close"

    Hello All

    Current button "Close" in Chart Trader closing all positions, cancelling all orders and disable strategies on the chart.
    I would like to add to the Chart Trader button "Close" which will be ONLY close manually opened positions and don't close active strategy.
    Is it possible? I know that NT8 divide positions: automatic placed positions and manually placed positions.
    I can take information about total account position but it not working with commands ExitLong() and ExitShort() because this commands working with strategy positions only.

    #2
    If you read the help page very carefully, the answer to what you're
    looking for is to click the Close button with the middle mouse button.

    See first paragraph here,

    Comment


      #3
      bltdavid ​, Thank you for your answer, but I would like know Which command do it

      Comment


        #4
        Hello vitaly_p,

        Thank you for your note.

        I am not aware of a way to close only the manually placed trades and not strategy-generated trades. You could consider using the Account class in an indicator script that adds a button to the Chart Trader, though differentiating which positions are manual vs. from a strategy could prove difficult. The Account class allows you to subscribe to Order, Position, and Execution updates for a specified account. You could generate an order to close out only the desired amount of contracts for desired instruments on that account. More info regarding the Account class may be found here:


        Otherwise, it may be more simple to use separate accounts for your manual trading than the account(s) you are running your strategies on. If you click the Close button, it will close all positions and disable strategies on that chart using the same account. If the strategy is running on a different account, it will not be disabled and if there is an open position, it will not be closed. Here is an example where I have the SampleMACrossover strategy running on Sim101 then I place a manual order and click Close for SimTest. The SimTest position is closed and the strategy remains active on Sim101:
        World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


        Please let us know if we may be of further assistance.

        Comment


          #5
          What I want to have:
          I can close manual position by click Close with middle button, I can close strategy position by my Strategy button.
          But sometimes I have the next situation: for example, I have strategy position 7 Long and I place 3 contracts Limit Order for Short. After execution my Bot position still 7 Long but my Account position will be 4 Long. In current situation if I want to close my position by Account I will hit my strategy button (my strategy position is 7 Long and it will be biggest than current account position) and my button will close all position by account.
          BUT in the situation when my Bot have for example 7 Long and I will opening 3 Long manually - I nee TWO clicks (one click by mu strategy button for closing 7Long and ane ckick by Close with middle button for closing manual position).

          Therefore I looking the way for closing all positions (automatic and manually) together.
          And I would like to know the command which will be close manually placed positions




          Comment


            #6
            Thank you Emily for your answer.
            If Close with middle button can close manually placed position - so NT have the command for it

            Comment


              #7
              Hello vitaly_p,

              Thank you for your reply.

              Using the middle mouse button on the "Close" button only closes positions with an associated ATM strategy. It does not work for all manually placed orders, so there still is no "command" to close only manually placed orders. Using the Close button to close ATM strategy positions may be done as follows:
              • If the order entry window ATM Strategy Selection Mode is NOT in "DisplaySelectedATMStrategyOnly" click on the "CLOSE" button via your middle mouse button (scroll wheel)
              • If the order entry window ATM Strategy Selection Mode is in "DisplaySelectedATMStrategyOnly" you can click on the "CLOSE" button with your left mouse button to close the selected active ATM strategy
              ​If you want to close an entire position for the same account and instrument altogether, both strategy and manually placed orders, you could also consider using the Positions tab of the Control Center > right-click on the desired position to close > select Close Position. You could even add a "Close" button to the Positions tab via the Properties menu so you don't have to right-click. If you don't want to use Positions via the Control Center, you could also open a New > Account Data window and select a Positions tab in that new window. For more information on the Positions tab:


              As a recap:
              • Therefore I looking the way for closing all positions (automatic and manually) together.
                • This may be done via a left-click on the Close button of the chart trader (depending on your ATM strategy selection mode - you may need to select "none" from the ATM strategy dropdown menu to include all ATMs with the Close function)
                • This may also be done via the Positions tab
              • And I would like to know the command which will be close manually placed positions
                • There is no command to close manually placed positions specifically. If you are manually trading ATM strategies while also having a NinjaScript strategy running on the same instrument and account, you could click the Close button with your middle mouse button to close only the ATM strategy
              It can be difficult to keep track of positions when trading multiple ways on the same instrument account, such as running multiple strategies at the same time or running one strategy while also manually trading. For more information, please see the following post:
              https://forum.ninjatrader.com/forum/...660#post792660

              You may want to consider running your automated strategy on a separate account from the one you are placing manual trades/ATM strategies. If you have a live account with NinjaTrader Brokerage, there is a way to request a sub-account and you could put a specific reason about running automated trades on one and manual trades on the other:


              Please let us know if we may be of further assistance.

              Comment


                #8
                Thank you Emily for your answer. I will think about available variants.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                20 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                119 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                63 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                41 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                45 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X