• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Proper way to add assembly reference in NT8?

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

    Proper way to add assembly reference in NT8?

    My indicator will use the Plot method.

    Code:
    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    within this I'll need to use SolidBrush etc so I need to add a reference to System.Drawing.

    What's the proper way to add a reference to an assembly in NinjaTrader 8? It's simply a matter of editing Config.xml and adding the following?

    <References>
    <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <string>System.Drawing.dll</string>

    Or should I be right-clicking in the indicator and choosing References -> add? And if I use the References menu option where should I navigate to find System.Drawing.dll (on a 64-bit system using NT 8 64-bit)?

    Is there a difference between these two methods?

    #2
    Hello overflowing,

    With NinjaTrader 8, there will no plot method to override. Instead this will be done in OnRender().

    http://ninjatrader.com/support/helpGuides/nt8/en-us/onrender.htm


    Further, rending will be done with sharpdx which means items will be drawn with BrushDX brushes instead of SolidColorBrushes.
    http://ninjatrader.com/support/helpG.../drawline2.htm
    http://ninjatrader.com/support/helpG...rectangle2.htm
    http://ninjatrader.com/support/helpG...ndertarget.htm

    To add a reference to NinjaTrader this can be done through the NinjaScript editor the same as it would be done for NinjaTrader 7. Right-click the NinjaScript editor -> select References... -> select the reference -> click OK.

    Then in the calling script add a using statement to the namespace in the referenced file.

    You will not need to add a reference to System.Drawing. This is already referenced in NinjaTrader. Try typing System.Drawing. in a script, the intelliview will open and show you what is available to the already referenced System.Drawing.

    However, if you want your script to perform, you will want to draw using the RenderTarget so that rendering is done on the GPU instead of the CPU.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      In my Config.Xml I do not see a reference to System.Drawing.dll

      Can you elaborate a little on Config.xml references section? When I add a reference via the user interface does this file get modified?

      Also what is RenderTarget? Is that a global or class that I call static methods on?

      Comment


        #4
        Hello overflowing,

        I double checked and found the System.Drawing reference was dropped because there should be no drawing with System.Drawing in NinjaTrader 8.

        You would need to manually add this reference.

        The RenderTarget will be the object that contains all of the lines, rectangles, and circles that will be rendered in each pass. This is created behind the scenes for any script that is added to a chart such as Indicators, Drawing tools, and Strategies.
        https://msdn.microsoft.com/en-us/lib...tudio.31).aspx

        Try taking a look at any of the drawing tools, or the VolumeZones indicator that shows how to draw using sharpdx.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by [email protected], Yesterday, 07:45 AM
        1 response
        8 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by tgn55, Today, 07:22 AM
        0 responses
        2 views
        0 likes
        Last Post tgn55
        by tgn55
         
        Started by U0000999, Today, 05:17 AM
        0 responses
        4 views
        0 likes
        Last Post U0000999  
        Started by Prataturry89, Today, 03:40 AM
        0 responses
        5 views
        0 likes
        Last Post Prataturry89  
        Started by UltraFastKetoBoost28, Today, 02:43 AM
        0 responses
        6 views
        0 likes
        Last Post UltraFastKetoBoost28  
        Working...
        X