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?
    BertrandNinjaTrader Customer Service

    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).
          BertrandNinjaTrader Customer Service

          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.
              BertrandNinjaTrader Customer Service

              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 techgetgame, Yesterday, 11:42 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post techgetgame  
                  Started by sephichapdson, Yesterday, 11:36 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post sephichapdson  
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,615 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Yesterday, 05:56 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  20 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Working...
                  X