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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X