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

    #16
    demo166130.

    What session template are you using?

    Does 9:45 fall within the trading hours for that instrument?

    Josh G.NinjaTrader Customer Service

    Comment


      #17
      It is yes. Is the problem with this command not that it will exit open trades, but that it will still continue to enter them even during the time periood we set because it's only instructing open trades to close, not trades not to open? Hope you catch my drift

      Comment


        #18
        Unsure what you mean by session template. I don't think I've changed anything template wise. 15 minute time bars on a regular AUD/USD CFD chart

        Comment


          #19
          demo166130,

          Sounds like you should create another time filter for your entries so you can limit when they occur.
          Josh G.NinjaTrader Customer Service

          Comment


            #20
            Hello!
            Can you please explaine, how can i set for a strategy, in Strategy Builder, period of time during the week (for example, start monday at 01:00 and finish friday at 22:00), when strategy could make trades? Friday at 22:00 it should close all open positions and stop till monday!
            Can't understand, how could it be done with time filters

            Comment


              #21
              Hello vvu1980,

              Thank you for your post.

              Unfortunately, since the market is closed on Friday at 10:00PM and no trading occurs, you would not be able to close all positions. All positions would need to be closed during active market hours.

              Something you could do is have your strategy place trades between Monday at 1:00AM - Friday at 12:00PM. Then, close all positions after Friday at 12:00PM.

              To do this you would need to first need to create a bool variable (initially set to false). Then you would need to create a condition in Set 1 with a time filter that checks if the day of the week is Monday and if the Time is greater than or equal to 1:00 AM. Then, we would set our bool to true in the actions section.

              In Set 2 we would create a condition that checks if the bool is true, if Position.MarketPosition == MarketPosition.Flat, if the Close[0] is greater than the Open[0], and call EnterLong to enter a long position.

              In Set 3 we would create another time filter that checks if the day of the week is Friday and if the time is greater than 12:00PM. Then, we would set our bool to false in the actions section.

              In Set 4 we check if the bool is false and if Postion.MarketPosition != MarketPosition.Flat followed by calling ExitLong.

              Please see the attached example strategy that demonstrates how this could be accomplished.

              Also, please open a new thread for inquiries in the future instead of bumping old forum threads. It is possible that we may miss your inquiry if you reply to an old forum thread.

              Let us know if we may assist further.
              Attached Files
              Brandon H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by pjsmith, Today, 01:00 AM
              1 response
              10 views
              0 likes
              Last Post NT-Roland  
              Started by alejandro888, Yesterday, 08:41 PM
              0 responses
              9 views
              0 likes
              Last Post alejandro888  
              Started by UltraNIX, Today, 02:14 AM
              0 responses
              8 views
              0 likes
              Last Post UltraNIX  
              Started by augustfay, Yesterday, 12:06 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by klaus w, Yesterday, 12:13 PM
              2 responses
              24 views
              0 likes
              Last Post klaus w
              by klaus w
               
              Working...
              X