Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ignoring x number of bars in middle

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

    Ignoring x number of bars in middle

    Hi ,
    I need help/example for this indicator.

    Sequence:
    Bar C5 ---> C4 ---> x number or bars (small bars compared to c5 and c4) ---> C3-->c2--C1

    x number mean any number 1-10. Can someone post a sample code which will do that ?

    I am not able to figure out how to ignore x number of bars in middle .

    Thanks in advance

    #2
    shashankg27, unfortunately I'm not exactly sure what you're asking here - do you wish to ignore these bars for calculations of indicator values so running on a custom array of values then, where you would not have index for each bar?

    Comment


      #3
      Hi Bertrand,
      X number of bars is random (based on market condition).
      some times it is 2, sometimes 10.

      In that case how to code ?

      Comment


        #4
        for example
        C5 ---> C4 ---> x1 x2 x3 ---> C3-->c2--C1

        C5--->C4 --> x1 x2 --->C3-->c2--c1

        Comment


          #5
          Well, what are you then first of all trying to calculate here? If you want to ignore bars in indicator calcs (like inside bars) then you would need to run on custom lists (more a C# topic).

          Comment


            #6
            yes something like ignoring all inside bars. Any example I can refer to ?

            Comment


              #7
              I would unfortunately not be aware of sample or code shared already for this topic.

              Comment


                #8
                Originally posted by shashankg27 View Post
                yes something like ignoring all inside bars. Any example I can refer to ?
                You simply determine on what condition you will ignore a bar for calculation, and do so. To address the specific example of Inside Bars that you cite:

                Code:
                 
                //We are checking one bar ago, so we need an escape
                if (CurrentBar < 1) return;
                 
                //Is it an inside bar?
                bool IsIgnoreBar = High[0] < High[1] && Low[0] > Low[1];
                 
                //if so, ignore processing for the bar
                if (IsIgnoreBar) return;
                 
                [COLOR=blue]// the rest of the processing goes here.[/COLOR]
                Naturally, you just need to change IgnoreBar to be whatever condition that you want to igore.

                Comment


                  #9
                  Thankyou this is helpful...

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  31 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, Yesterday, 02:41 AM
                  0 responses
                  14 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  22 views
                  1 like
                  Last Post CaptainJack  
                  Started by CarlTrading, 03-30-2026, 11:51 AM
                  0 responses
                  40 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CarlTrading, 03-30-2026, 11:48 AM
                  0 responses
                  34 views
                  0 likes
                  Last Post CarlTrading  
                  Working...
                  X