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 pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    148 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,282 views
    0 likes
    Last Post Leafcutter  
    Working...
    X