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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      283 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X