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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    31 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    286 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    283 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    133 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    91 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X