Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compile Errors when converting NT7 to NT 8

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

    Compile Errors when converting NT7 to NT 8

    Converting a custom indicator from NT 7 to NT 8 and getting a compile error "System.Windows.Media.Color" does not contain a definition for "Empty", error C0117, on this and similar lines including Color.Red Color.Blue etc.:

    Code:
    Draw.Text("PossLow", true, "--", 0, lowMarker, 2, LowBar, new NinjaTrader.Gui.Tools.SimpleFont("Impact", 16), TextAlignment.Center, Color.Empty, Color.Empty, 10);
    Also getting, The type or namespace name "Design" does not exist in the namespace "NinjaTrader.Gui, error CS0234 in these lines:

    Code:
    get { return Gui.Design.SerializableColor.ToString(colorNeutral); }
    set { colorNeutral = Gui.Design.SerializableColor.FromString(value); }
    I have searched code breaking changes and the Microsoft links on the errors but there is no clear indication of how to fix it.

    Any tips appreciated.
    Last edited by Trader_Mark; 07-23-2017, 12:37 PM.

    #2
    Hello Trader_Mark,

    NinjaTrader 8 uses brushes instead of colors.

    Draw.Text(NinjaScriptBase owner, string tag, bool isAutoScale, string text, int barsAgo, double y, int yPixelOffset, Brush textBrush, SimpleFont font, TextAlignment alignment, Brush outlineBrush, Brush areaBrush, int areaOpacity)


    Use Brushes.Transparent in place of Color.Empty.


    Also regarding serializing a brush, see this Tips article with an example.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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