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

How do I NOT use the wizard?

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

    How do I NOT use the wizard?

    The actual question .. How do I draw things on the screen without using the Wizard to first place them in my Indicator, and without altering the DO NOT TOUCH code?

    Hi everyone! I am an experienced programmer (including c#) but I'm very new to the trading side of things.

    I am trying to get my feet wet so I've come up with a list of indicators I want to program.
    I wrote a swing high indicator that would do the 5 bar calculation and put an arrow on top. Works great!

    I now want to add an additional triangle for swing low placement.

    Except, it won't compile unless I go into the code labeled "DO NOT TOUCH" and add my new triangle definition... ? . I looked through it. Looks straightforward but I don't want to assume anything.. I'm pretty sure I can't go back to Wizard mode and add it as I added code all over the thing.

    I do not want to program everything separately. I want to develop 1 core system that does a bunch of complex data analysis and drawing, likely at random...

    I haven't started programming strategies yet but can I draw from a strategy? What is the best software architecture to build to encompass what I am trying to accomplish here?

    Sorry I wrote a book.
    -Chris

    #2
    Hello,

    Thank you for the question.

    In an Indicator, the section labeled
    #region NinjaScript generated code. Neither change nor remove.
    This is correct you would not want to change or remove this section of code. If you are unable to compile without getting errors this would mean there is an error somewhere in your syntax outside of this area, this region of code will automatically be generated and refreshed when the compile is successful so you can really just completely ignore this section of code all together.

    To answer your question of
    How do I draw things on the screen without using the Wizard to first place them in my Indicator
    This can be accomplished with the DrawingTools. I would recommend looking over the Drawing section in the NinjaScript manual located here: http://www.ninjatrader.com/support/h...t7/drawing.htm

    The help guide (navigation on left) will show you all of the defined methods and properties of a NinjaScript file, each section has example code as well. The Drawing section shows all the possible drawing options and has a sample for each when you click on it.

    After you generate a indicator and have a basic setup, the indicator will be manually coded from that point on and there is not a way to go back into the wizard. Because you may not know the code needed for many items yet, You can use code automation in the NinjaScript editor by pressing the F2 key to access code snippets to help in learning. This will pre populate the line with the code and overloads needed to complete basic tasks and will allow you to learn the code so you can manually do this later.

    I do not want to program everything separately. I want to develop 1 core system that does a bunch of complex data analysis and drawing, likely at random..
    For what you are describing, it would actually be best to do this all separately as this makes things easier in NinjaTrader. Your main strategy can be one file, but for the other items such as indicators and repetitive calculations these are best separated into single indicators. This allows you to reduce the lines of code for each item making it ultimately easier to read and edit, you can then call these scripts by a single line of code to get your output values, this allows you to only see the logic in your strategy and not a lot of lines of calculation logic.

    I would recommend getting well acclimated with indicators and how to expose and use the values from indicators before taking on the entire strategy project, this will greatly help you in learning NinjaScript development and is necessary for when you do create your strategy.


    If you look at this link: http://www.ninjatrader.com/support/f...splay.php?f=29
    There are a lot of reference samples and tips, these are complete indicators or strategies that demonstrate core concepts. I would highly recommend looking at these as they contain a lot of great information.

    I haven't started programming strategies yet but can I draw from a strategy? What is the best software architecture to build to encompass what I am trying to accomplish here?
    You can use DrawingObjects in a strategy but you can not plot. Ultimately it is best for an indicator to do all the visual/calculating work and the strategy to stick to the orders logic that is based on the data from indicator you created.

    I am not sure what you mean by what software architecture to use, NinjaTrader has a full script editor and is self compiling so no other software is required.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you for the help Jesse! It's great to get real answers from people. The documentation helped a lot.

      Notes... The documentation seems a little incomplete (See overloads of RemoveDrawObject) but it's been quite useful! .. Also, your full script editor is a bit lacking in features and polish... Like user definable keyboard shortcuts... and I found a bug I need to report (when I figure out where to report it) where the cursor resets to the top of the page when you save.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bmartz, 03-12-2024, 06:12 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      13 views
      0 likes
      Last Post Aviram Y  
      Started by algospoke, 04-17-2024, 06:40 PM
      3 responses
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by cls71, Today, 04:45 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X