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 trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    22 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Started by guillembm, Yesterday, 11:25 AM
    2 responses
    9 views
    0 likes
    Last Post guillembm  
    Started by junkone, 04-21-2024, 07:17 AM
    9 responses
    70 views
    0 likes
    Last Post jeronymite  
    Started by mgco4you, Yesterday, 09:46 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X