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 Christopher_R, Today, 12:29 AM
                      0 responses
                      7 views
                      0 likes
                      Last Post Christopher_R  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      166 responses
                      2,235 views
                      0 likes
                      Last Post sidlercom80  
                      Started by thread, Yesterday, 11:58 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post thread
                      by thread
                       
                      Started by jclose, Yesterday, 09:37 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post jclose
                      by jclose
                       
                      Started by WeyldFalcon, 08-07-2020, 06:13 AM
                      10 responses
                      1,415 views
                      0 likes
                      Last Post Traderontheroad  
                      Working...
                      X