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

Converting NT7 strategy to NT8?

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

    Converting NT7 strategy to NT8?

    Here's a question I'd think you'd be answering for the past year - where is there a guide on migrating a strategy from NT7 to NT8? As an example, my NT 7 strategy has the declaration:

    using System.Drawing.Drawing2D;

    which does not exist in the NT8 namespace. So, I'm wondering if I just need to use a different namespace, or also convert all of the plotting statements, which depend upon this namespace. And a few other questions like this too.

    Your thoughts? Thanks,

    #2
    Hello timmbbo,

    There are a few key items to look for when converting your scripts from NinjaTrader 7 format to NinjaTrader 8, and we keep a Code Breaking Changes table updated in the NinjaTrader 8 Help Guide to assist in identifying changes or new implementations of familiar methods and properties from NinjaTrader 7: http://ninjatrader.com/support/helpG...ng_changes.htm

    Some notable items to consider when converting your code will be the following:

    Initialization has changed significantly. Initialize() has been replaced with OnStateChange(), which can be used to filter out different stages of the entire life cycle of a script (SetDefaults, Configure, Historical, Realtime, Terminated, etc.) OnStateChange() is fully covered in the Help Guide.

    The names of many methods and properties have changed slightly, so you will need to refactor these in your code. The Code Breaking Changes table can make this task much easier, and there is also an alphabetical reference in the Help Guide that can help to find new method/property names: http://ninjatrader.com/support/helpG..._reference.htm

    In numerous instances, you now have direct access to objects, where in NinjaTrader 7 you had to work with interfaces. For example, rather than the IOrder interface, you now have direct access to an Order object and its related fields. This will require a change in the way items like this are handled in your code.

    What we recommend is that you use the indicator wizard or strategy wizard to create the basic structure of the ninjascript. From the helpguide, "The NinjaScript Wizard is used to generate the minimum code to get started programming any supported NinjaScript type. This wizard will allow you to define any default properties, add custom input parameters, add additional data series, and add any relevant event methods. There are a number of different properties and options available in the NinjaScript Wizard depending on the type of NinjaScript object you are creating." Reference: http://ninjatrader.com/support/helpG...?ns_wizard.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Stanfillirenfro, Yesterday, 09:19 AM
    7 responses
    51 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by TraderCro, 04-12-2024, 11:36 AM
    4 responses
    69 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Mindset, Yesterday, 02:04 AM
    1 response
    15 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by agclub, 04-21-2024, 08:57 PM
    4 responses
    18 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Irukandji, Today, 04:58 AM
    0 responses
    3 views
    0 likes
    Last Post Irukandji  
    Working...
    X