Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

System.Drawing Reference Missing

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

    System.Drawing Reference Missing

    When converting several custom indicators I created under Ninjatrader 7 to Ninjatrader 8, I am trying to define the Using reference System.Drawing at the top of my script (see attached picture). However the Drawing reference does not show up under the System object.

    I am receiving the compiler error "The type or namespace StringFormat could not be found" which is defined under the System.Drawing object.

    I am running Ninjatrader 8 under OS Windows 10. I am able to see the .Net 4.6 System.Drawing object under MS Visual Studio object browser so I know its there. Plus I am able to see the System.Drawing reference object when I run Ninjatrader 7 - just not under Ninjatrader 8.

    Any ideas?
    Attached Files

    #2
    Hello dsh2687,

    Thank you for writing in. NinjaTrader 8 uses System.Windows.Media instead of System.Drawing so System.Drawing is not included by default. To add a reference to the System.Drawing namespace so it can be used please follow the steps below:

    Create a new NinjaScript Editor.
    Open a file and right click in the editor.
    Choose "References...".
    Click "add".
    Browse to the .Net assemblies folder (should be %windowsdir%\Microsoft.NET\Framework\v4.0.30319 or something similar).
    Select "System.Drawing" and click add.

    This will add in the System.Drawing.dll to the references for NinjaTrader.Custom.dll so you can add a using declaration.

    Please let me know if this does not resolve the issue or if I may be of further assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    45 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    99 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    177 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    170 views
    0 likes
    Last Post CarlTrading  
    Working...
    X