• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
        https://ninjatrader.com/support/foru...121#post791121
        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.
                    https://drive.google.com/file/d/1HCY...w?usp=drivesdk
                    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.

                        https://ninjatrader.com/support/foru...660#post792660
                        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 fx.practic, Today, 03:10 PM
                            1 response
                            4 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by jertrade, Today, 02:50 PM
                            0 responses
                            3 views
                            0 likes
                            Last Post jertrade  
                            Started by Emma1, Today, 02:42 PM
                            0 responses
                            8 views
                            0 likes
                            Last Post Emma1
                            by Emma1
                             
                            Started by RedDuke, Today, 01:59 PM
                            1 response
                            17 views
                            0 likes
                            Last Post NinjaTrader_Kate  
                            Started by MarianApalaghiei, Today, 01:18 PM
                            1 response
                            15 views
                            0 likes
                            Last Post NinjaTrader_PatrickG  
                            Working...
                            X