Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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

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

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

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by rene69851, 05-02-2024, 03:25 PM
                      1 response
                      20 views
                      0 likes
                      Last Post rene69851  
                      Started by ETFVoyageur, Yesterday, 07:05 PM
                      5 responses
                      43 views
                      0 likes
                      Last Post ETFVoyageur  
                      Started by jpeep, 08-16-2020, 08:31 AM
                      13 responses
                      487 views
                      0 likes
                      Last Post notenufftime  
                      Started by realblubb, 04-28-2024, 09:28 AM
                      2 responses
                      32 views
                      0 likes
                      Last Post realblubb  
                      Started by bmarovets, Today, 06:33 PM
                      0 responses
                      12 views
                      0 likes
                      Last Post bmarovets  
                      Working...
                      X