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.

    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.

        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 argusthome, 03-08-2026, 10:06 AM
          0 responses
          65 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          41 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          23 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          26 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          52 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X