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 Belfortbucks, Today, 09:29 PM
          0 responses
          6 views
          0 likes
          Last Post Belfortbucks  
          Started by zstheorist, Today, 07:52 PM
          0 responses
          7 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          151 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          6 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Working...
          X