Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Make a strategy that exits a position after a specific amount of time

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

    Make a strategy that exits a position after a specific amount of time

    Is it possible to make a command in Strategy Builder that will exit a trade after a certain amount of time has passed since entry? For example, if my strategy has entered a trade, and the position is still open after one hour, I want the strategy to exit the trade for me.

    #2
    I don't think that it is possible, if you use OnBarUpdate. But if moderators would tell otherwise, I am eager to find out how.

    Comment


      #3
      Hello erin_l,

      Welcome to the forums!

      This would not be possible in the Strategy Builder since the Strategy Builder is limited to event based Bar Updates. Your logic is processed as bars are formed (and tick data is received to form these bars.)

      It is possible to incorporate a timer in unlocked scripts to achieve time delayed events. An example indicator that incorporates a timer can be found below, and another is attached. The same logic could be implemented in a strategy if you wish.

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

      We look forward to assisting.
      Attached Files
      JimNinjaTrader Customer Service

      Comment


        #4
        Thank you for the information. I am wondering if I can make a strategy read two different charts at once. For example, if I have a strategy which trades on the 2000 tick chart, could I add part of the strategy to exit trades based on the minute chart? Or if I have a strategy that only enters trades on the 2000 tick chart, could I make a separate strategy that exits trades based on the minute chart?

        Comment


          #5
          Hello erin_l,

          Strategies only know about the data series they are added to or the data series' that are added within the strategy itself.

          Strategy Builder strategies can only process logic in Conditions and Actions based on the data series we apply the strategy to, but additional data can be added and used in the strategy logic. Indicators can be based off of the additional data and logic can be written to reference the additional data. Additional data can be added in the Additional Data page of the Strategy Builder.

          That data can then be referenced in an Indicator's Input Series, or the Series property for a PriceSeries like Open, High, Low, or Close.

          If you would like to process logic as the additional data series update, you can unlock the code and follow our Multi time Frame and Instrument documentation.

          Multi time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RobotSyndicate, Today, 04:27 AM
          0 responses
          4 views
          0 likes
          Last Post RobotSyndicate  
          Started by Ray12345, Today, 04:10 AM
          0 responses
          4 views
          0 likes
          Last Post Ray12345  
          Started by Behungr101, Today, 02:16 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by omermirza, Yesterday, 08:37 PM
          2 responses
          12 views
          0 likes
          Last Post NT-Roland  
          Started by aelagha, Today, 01:28 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Jason  
          Working...
          X