Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Consecutive Bars

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

    Consecutive Bars

    Hello - how would I program, "exit trade, if 7 consecutive bars do not increase P&L"

    The consecutive bars portion is where I am struggling.

    Thank you

    #2
    titleistbb22,

    Unfortunately we cannot work through the full logic for you, but here are a few hints:

    -You need to keep track of the previous bar's PnL.
    -When the current bar's PnL is not > last bar's then increase a counter
    -If current bar's PnL is > last bar's then reset counter to 0
    -When counter reaches 7, ExitLong.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      thank you that is helpful

      Comment


        #4
        titleistbb22: Did you manage to successfully program this strategy?
        If you did, I would love to see how you did it, since I am currently trying to program a similar strategy that involves PnL and consecutive bars.

        Comment


          #5
          No I never did - still like to figure it out if you or someone else could provide some hints. thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by lorem, Yesterday, 09:18 AM
          4 responses
          13 views
          0 likes
          Last Post lorem
          by lorem
           
          Started by Spiderbird, Today, 12:15 PM
          0 responses
          5 views
          0 likes
          Last Post Spiderbird  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          12 responses
          42 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by FrazMann, Today, 11:21 AM
          0 responses
          6 views
          0 likes
          Last Post FrazMann  
          Started by geddyisodin, Yesterday, 05:20 AM
          8 responses
          52 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X