Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to exit trades at set day of week and time

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

    How to exit trades at set day of week and time

    Just trying to use the Strategy Builder to say exit all open trades on Friday's at 9:45

    #2
    Hello demo166130
    Thanks for your post.

    You could create a time filter and then exit your positions when the time is reached. There is a sample of how to create a time filter inside the Strategy Builder located in our help guide.

    https://ninjatrader.com/support/help...ateTimeFilters

    Even though you are creating this strategy in the Strategy Builder, it may be of help to look at the following code sample. This sample demonstrates how to limit trading hours with a time filter.

    https://ninjatrader.com/support/help...to_limit_t.htm

    Let me know if you have any questions.

    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thankyou mate

      Comment


        #4
        I'm having a few issues. I've attached what I've done so far, please take a look and let me know your thoughts.
        Attached Files

        Comment


          #5
          demo166130,

          Nothing stands out from what I see here. What seems to be the issue?
          Josh G.NinjaTrader Customer Service

          Comment


            #6
            I watched a trade which entered on a Friday and carried over the weekend meaning the logic hasn't had the intended effect

            Comment


              #7
              demo166130,

              I looked at your screenshots again and I see that your condition that tests for Friday is never going to be true. It looks like you may be comparing Friday to a Time Series instead of a Date Series.

              It should look something like my screenshot to create a condition for Friday.
              Josh G.NinjaTrader Customer Service

              Comment


                #8
                I changed this and it still made no difference. I decided to try and exit trades during lots of times of day and it also made zero difference. The chances that I'm doing something wrong here are far far more likely than there's some weird error in the system. I've attached another image, curious to see what you think.
                Attached Files

                Comment


                  #9
                  demo166130,

                  The field from your screenshot is there because you added another data series.

                  Are you testing this in the Strategy Analyzer?
                  Josh G.NinjaTrader Customer Service

                  Comment


                    #10
                    Yes, is what you just saw looking correct?

                    Comment


                      #11
                      Do I need to use a signal name here?

                      Comment


                        #12
                        demo166130,

                        You do not need to include the signal name in this case.

                        Can you post the .cs file for your strategy here?
                        Josh G.NinjaTrader Customer Service

                        Comment


                          #13
                          Sure, where abouts is the strategy cs file located? I will get it over to you

                          Comment


                            #14
                            demo166130 ,

                            That would be in your \Documents\NinjaTrader 8\bin\Custom\Strategies\ folder
                            Josh G.NinjaTrader Customer Service

                            Comment


                              #15
                              Here you go.
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by toughiee, Today, 12:04 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post toughiee  
                              Started by vdoan20, Yesterday, 08:30 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post vdoan20
                              by vdoan20
                               
                              Started by gupagoer, Yesterday, 07:42 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post gupagoer  
                              Started by Holligoly, Yesterday, 05:13 PM
                              2 responses
                              11 views
                              0 likes
                              Last Post Holligoly  
                              Started by Raginpower, Yesterday, 01:53 PM
                              0 responses
                              14 views
                              0 likes
                              Last Post Raginpower  
                              Working...
                              X