Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Flatten Positions

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

    Strategy Builder Flatten Positions

    What do I need to do in order to flatten positions at 4:00 PM using Strategy Builder? I know how to input trading times however it is not closing potions.

    #2
    Hello TheMasterBlaster,

    Welcome to the NinjaTrader forums.

    You would need a condition set that compares Time series on the left to Time value on the right set to 4:00 PM, and then for the action calls Exit a long position and Exit a short position.

    This would cause an exit order to be submitted at that time.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you. Now that I have that figure out I'm trying to set my trading hours from 6:00 PM EST - 4:00 PM EST. When I set it up it doesn't take any trades.

      Comment


        #4
        Hello TheMasterBlaster,

        Is the time filter the only conditions that trigger the order? Are there other conditions?

        Use prints to understand the behavior.

        Print all values in all conditions that lead the to entry order to the output window along with the time of the bar.

        Below is a link to a forum post with a video that demonstrates how to use prints to understand behavior using the Strategy Builder.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Still struggling with setting my trade times. Trying to trade from 6:00 PM EST - 4:00 PM EST. I have added this to my strategy and it won't take any trades.

          Comment


            #6
            Hello TheMasterBlaster,

            Are you comparing entire date times or just the time part of the date?

            A number (time in one day) cannot be greater than 18 (6:00 PM) and less than 16 (4:00 PM) at the same time.

            It can be greater than 0 (12:00 AM) and less than 16 (4:00 PM) OR equal to or greater than 18 (6:00 PM) and less than 24 (12:59:59).

            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I set the times @ Greater than 6:00 PM less that 11:59 PM
              Greater than 12:01 AM less than 4:00 PM

              Comment


                #8
                Hello TheMasterBlaster,

                With these condition groups in the single condition set using 'If Any' for the OR between the condition groups, and no other conditions or condition groups in that set, this condition set is not triggering?

                Are you printing or drawing a dot to ensure the condition is evaluating as true?

                May I have a screenshot of the condition set with only those conditions?
                (The screenshot you have provided above has conditions that cannot evaluate as true.)
                Last edited by NinjaTrader_ChelseaB; 06-12-2019, 03:45 PM.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  When I remove the times I have showed in the picture my strategy takes the trade. When I add those times that are in the picture it doesn't take any trades. Have verified with backtesting. What is the correct way to add the trading hours I have posted? 6:00 PM - 4:00 PM.

                  Comment


                    #10
                    Hello TheMasterBlaster,

                    Yes, for one condition set or condition group you can have greater than 0 (12:00 AM) and less than 16 (4:00 PM). And in another condition set you can have equal to or greater than 18 (6:00 PM) and less than 24 (12:59:59).

                    Below is a link to a video that demonstrates putting these in different sets which is the simple way. Using condition groups with the 'If Any' (for conditional OR operators) is cleaner code but more complex.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      If I'm running multiple Auto Strategies on the $NQ with the same account will the orders on one of the strategies effect the other strategy?

                      Comment


                        #12
                        Hello TheMasterBlaster,

                        Yes, all orders from all strategies and all manually placed orders placed to the same account and same instrument will affect the account position.

                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          If I have a strategy for the ES & NQ running at the same time on the same account will they effect one another?

                          Comment


                            #14
                            Hello TheMasterBlaster,

                            ES and NQ are separate instruments and running separate strategies on these instruments will not cause any interference with Strategy/Account Positions.

                            It would not be advised, however, to apply multiple strategies against the same instrument as this can cause the Strategy's position to fall out of sync with the Account. For example, if one strategy flattens its position, the account may still be long.

                            Strategy vs. Account Position - https://ninjatrader.com/support/help..._account_p.htm

                            Please let us know if you have any additional questions.
                            JimNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Barry Milan, Yesterday, 10:35 PM
                            3 responses
                            10 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Started by WeyldFalcon, 12-10-2020, 06:48 PM
                            14 responses
                            1,428 views
                            0 likes
                            Last Post Handclap0241  
                            Started by DJ888, 04-16-2024, 06:09 PM
                            2 responses
                            9 views
                            0 likes
                            Last Post DJ888
                            by DJ888
                             
                            Started by jeronymite, 04-12-2024, 04:26 PM
                            3 responses
                            41 views
                            0 likes
                            Last Post jeronymite  
                            Started by bill2023, Yesterday, 08:51 AM
                            2 responses
                            16 views
                            0 likes
                            Last Post bill2023  
                            Working...
                            X