Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NTClosePosition()

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

    NTClosePosition()

    If CurrentPosition = 0, ie flat, can this command [NTClosePosition] still be safely used?

    It won't cause any errors on instruments without a current position will it?

    #2
    imported post

    Hello Oli:

    Thank you for your post.

    According to your post, if your current position is already flat (=0), then clicking the 'Close' button will not cause errors since you are already flat. If you left click on the 'Close' button, it will flatten your position if you have a current position in the SuperDOM.

    Please clarify for me your question. Do you mean if I have multiple SuperDOM's open and click the 'Close' button, will it flatten all of my current positions?

    Best regards,

    Ryan
    RyanNinjaTrader Customer Service

    Comment


      #3
      imported post

      sorry for not being clear there,

      NTClosePosition() is a command issued as part of an ATI script, not from within NT

      Comment


        #4
        imported post

        It's safe.

        Ray
        RayNinjaTrader Customer Service

        Comment


          #5
          Definition question for NT Commands

          I want to use NT Commands, spefically; NTClosePosition

          Currently running NJ7 and IB. Perahps a silly question but how do i get the strategy
          being developed to recognise the functions. Get a compile error that the command does not exist. Any simple examples?

          Actually I want to NTFlattenEverything for only a said account if it violates a CashValue. But I think this NTFlattenEverything all accounts. Best way?

          Comment


            #6
            BluePoint,

            These commands are not for a NinjaScript automated strategy.

            They're used in our ATI interface for processing external signals through NinjaTrader.

            With NinjaScript, you flatten positions with:
            ExitLong();
            ExitShort();

            There are new account properties in version 7:


            This sample offers examples on using the performance class for money management:
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Yes but will the :

              ExitLong();
              ExitShort();

              Flatten the account even though the strategy to did not create the original entry?

              Comment


                #8
                No, these will only apply to positions opened by the strategy. Unfortunately there aren't supported methods that offer this, but you may want to check out the undocumented / unsupported thread for some ideas.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Hints that can flatten for 1 account only not all

                  Thanks NinjaTrader_RyanM.

                  Can you give any more hints that can flatten for 1 account only not all account connections?

                  Comment


                    #10
                    Originally posted by Bluepoint View Post
                    Thanks NinjaTrader_RyanM.

                    Can you give any more hints that can flatten for 1 account only not all account connections?
                    Bluepoint, this is unfortunately not supported as Ryan already pointed out.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by cre8able, Today, 01:01 PM
                    0 responses
                    1 view
                    0 likes
                    Last Post cre8able  
                    Started by manitshah915, Today, 12:59 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post manitshah915  
                    Started by ursavent, Today, 12:54 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post ursavent  
                    Started by Mizzouman1, Today, 07:35 AM
                    3 responses
                    17 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by RubenCazorla, Today, 09:07 AM
                    2 responses
                    13 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X