Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

max consecutive long/short bars in wizard

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

    max consecutive long/short bars in wizard

    Hi using the strategy wizard in a 20 Range chart, I'm trying to calculate something like "IF there's at least one bar that closed green in the last 4 bars, go ahead and enter short".

    Another way to put it would be "IF there's a max of 3 bars that have closed below their respective previous bar's close in a row, go ahead and short. If there's more than 3 in a row, cancel".

    I was thinking some indicator related to bar colors could work, but haven't been successful at it.

    Thanks a lot!

    #2
    Hello mmetry,

    Thank you for your note.

    You can use the NBarsDown indicator with a BarCount of 4 to check if the last 4 bars are down bars, if not it will return a value of 0 if it is true it will return 1.
    So we can say if NBarsDown == 0 then go short.
    We will need to setup a User defined input of 0.

    I have created a video demonstrating how to setup this condition and action. You may view this video at the following link: http://screencast.com/t/QPjojpslD

    Please let me know if you have any questions.

    Comment


      #3
      Worked like a charm. Very nice idea to throw an example screencast in there too, much appreciated!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      67 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X