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

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 algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    46 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    23 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    181 views
    0 likes
    Last Post jeronymite  
    Working...
    X