Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Srrange Behavior with DrawRegion

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

    Srrange Behavior with DrawRegion

    I've tried to use a DrawRegion with a TriggerLine indicator but am getting a strange separation if I look back a number of bars of data.

    Have been looking but can't find what might be causing this.

    Does anyone have any ideas?

    Thanks,

    taddypole...
    Attached Files

    #2
    Originally posted by Taddypole View Post
    I've tried to use a DrawRegion with a TriggerLine indicator but am getting a strange separation if I look back a number of bars of data.

    Have been looking but can't find what might be causing this.

    Does anyone have any ideas?

    Thanks,

    taddypole...
    Your DrawRegion instruction asks the indicator to color the region between the value1 and value2 DataSeries. It is doing that correctly, as print statements would show. Maybe I misunderstand?

    Comment


      #3
      I've added some color to the shading and taken another picture.
      It's Monday evening and the last separation occurred last night around 2:00 AM.
      It almost looks like a polarity reversal. The shaded area does not follow inside the trigger lines prior to 2:00 AM. After 2:00 AM it does and is correct.

      I keep looking but don't see what could be causing it.

      Thanks for taking a peak...
      Attached Files

      Comment


        #4
        More testing reveals that the problem occurs 255 bars in the past.
        i.e. as each new bar is added the problem moves forward at -255 bars.

        And this is consistent on 3 different time frames I've tried.
        55 tick, 220 tick and 880 tick charts. It's always 255 bars ago.
        Last edited by Taddypole; 02-22-2011, 12:11 AM.

        Comment


          #5
          Taddypole, your indicator will not plot correct in NT7, from your picture it looks like you are running NT7? The code need to be rewritten to make it plot the correct way in NT7

          Comment


            #6
            Taddypole, do you see the same issue if running this indicator in NT7 with the infinite setting for the DataSeries?

            Comment


              #7
              Yes, I am running NT7 and i have the code:

              MaximumBarsLookBack = MaximumBarsLookBack.Infinite;

              in the Initialize block.

              Comment


                #8
                Did you recompile and readd the indicator fresh after this change? The attached works ok for me here.
                Attached Files

                Comment


                  #9
                  ok.. that was the trick...
                  hadn't reapplied.

                  Thanks for you help. It works now.

                  Comment


                    #10
                    Bertrand,

                    I have a question, I only want to have DrawRegion draw during the live data part of the chart.

                    How do I keep NT from drawing DrawRegion in the Historical data part of the chart?

                    Thanks,

                    RJay
                    RJay
                    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                    Comment


                      #11
                      Hi RJay, did you try returning out of OBU with Historical?



                      You would then need to reflect this 'realtime only' use in your DrawRegion startBarsAgo variables as well.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      566 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      330 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      547 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      548 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X