Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait until flat before executing live

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

    Wait until flat before executing live

    I'm afraid I'm struggling a little to understand the "Wait until flat before executing live" setting.

    What is "flat"?

    #2
    Hello James,

    When you are flat this means that you are currently not in a position.

    You can be Long, Short or Flat for an account position so the statement "Wait until flat before executing live" will do as it says. This makes the strategy wait until your account position is flat before submitting live orders.

    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Not executing if Account position Flat

      Is there any code that prevents a strategy firing if the ACCOUNT position is not flat? For example a position in another instrument on the particular account would prevent the strategy firing.

      Simple concept but I cannot find the right code to achieve this.

      Comment


        #4
        Hello,

        There is no method to prevent a strategy from trading as this relies on the logic you create that produce the orders, if you tell the strategy not to do anything it will not do anything you just need to write the logic to place trades or not depending on a variable.

        For this there is no documented or supported method currently but you could look into this post.
        This essentially allows you to query the account and check for positions although this is not guaranteed to be in sync as it is not supported so please be aware of that.

        Support for the development of custom automated trading strategies using NinjaScript.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Account flat before trading

          I am currently testing this code:

          && Account.Positions.Count <=0

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by SentientDavid, Today, 01:34 AM
          0 responses
          2 views
          0 likes
          Last Post SentientDavid  
          Started by MrForgetful, Today, 01:28 AM
          0 responses
          2 views
          0 likes
          Last Post MrForgetful  
          Started by falcondroneus, Today, 01:15 AM
          0 responses
          2 views
          0 likes
          Last Post falcondroneus  
          Started by Vikuno1, 11-28-2023, 11:42 PM
          15 responses
          357 views
          1 like
          Last Post PaulMohn  
          Started by PaulMohn, Yesterday, 02:06 AM
          3 responses
          12 views
          0 likes
          Last Post PaulMohn  
          Working...
          X