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

DRAWREGION with 2 DataSeries Shifts when we look backwards

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

    DRAWREGION with 2 DataSeries Shifts when we look backwards

    I have a problem with using Drawregions and 2 DataSeries. It works fine with current day but if we move the chart backwards the colored regions shift and I do not know why. I post here the code and a pic.

    The regions should be +/- 2 TickSizes around the lines. Any idea about how to solve it?. Thanks in advanced...

    if (BarsInProgress != 0) return;
    if (CurrentBars[1]<30) return;
    if (CurrentBars[0]<30) return;

    double value1=PriorDayOHLC().PriorHigh[0];
    double value2=PriorDayOHLC().PriorLow[0];
    double value3 = Swing(BarsArray[1],5).SwingHigh[0];
    double value4 = Swing(BarsArray[1],5).SwingLow[0];
    Max2D.Set(value1);
    Min2D.Set(value2);
    SwingH30.Set(value3);
    SwingL30.Set(value4);
    MAX2Da.Set(value1+
    2*TickSize);
    MAX2Db.Set(value1-
    2*TickSize);
    DrawRegion(
    "MAXIMO 2 DIAS", CurrentBar, 0, MAX2Da, MAX2Db, Color.Green, Color.LimeGreen, 2);
    Attached Files

    #2
    Hello Sangui,
    To assist you further can you please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.

    *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Sure I will do it now. Thanks

      Comment


        #4
        Hello Sangui,
        This is to confirm I have received your email and has replied back to it.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Everything goes well now. Thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cre8able, Today, 01:01 PM
          0 responses
          2 views
          0 likes
          Last Post cre8able  
          Started by manitshah915, Today, 12:59 PM
          0 responses
          3 views
          0 likes
          Last Post manitshah915  
          Started by ursavent, Today, 12:54 PM
          0 responses
          3 views
          0 likes
          Last Post ursavent  
          Started by Mizzouman1, Today, 07:35 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by RubenCazorla, Today, 09:07 AM
          2 responses
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X