Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Region help

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

    Draw Region help

    Hello.

    Having tried for some time.

    Help with converting the following from NT7 to NT8 would be greatly appreciated to help me start to get to grips with this.



    Many thanks

    NT7 code:-


    Code:
    if ((High[0] > High[1]) && (Low[0] < Low[1]))
    
    DrawRegion("OBA"+CurrentBar.ToString(), 1, 0, MAX(High, 0), MAX(Low, 0), Color.Empty, obPennColor, pennTransparency);
    
    else
    
    RemoveDrawObject("OBA"+CurrentBar.ToString());
    Last edited by dj22522; 12-21-2021, 10:24 AM.

    #2
    Hello dj22522,

    Thanks for your post.

    I may suggest using the Code Breaking Changes page of the Help Guide, and to reference documentation for NinjaTrader 7 and NinjaTrader 8 to see the code differences. From here, you point out the overloads you are using and map the parameters to the NinjaTrader 8 overload.

    Most notably, the first parameter of the NinjaTrader 8 drawing tool method is the owning NinjaScript. Most often this. The second major item to note is that NinjaTrader 8 will use Brushes as opposed to Colors.

    Code Breaking Changes - https://ninjatrader.com/support/help...ng_changes.htm

    NinjaTrader 8 documentation - https://ninjatrader.com/support/help...raw_region.htm

    NinjaTrader 7 documentation - https://ninjatrader.com/support/help...drawregion.htm

    Let us know if you have any additional questions.
    Attached Files

    Comment


      #3
      NinjaTrader_Jim

      Thank you for your reply.

      I appear to have done it . Wonders never cease.
      Last edited by dj22522; 12-21-2021, 10:24 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 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
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X