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 bortz, 11-06-2023, 08:04 AM
          47 responses
          1,603 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          8 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          4 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          12 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X